ComponentStatus - to stream, or not to stream
              
              #266
            
            Replies: 1 comment
-
| 
         I guess this discussion is broader, at some point (probably not too far in the future) we'll need to be notified of any changes in the component graph. See: So my feeling is we should have a streaming RPC to get notified about any  This might be similar to https://github.com/frequenz-floss/frequenz-api-dispatch/ where we have a  If we unify the approach, we could even have a common client implementation to do this (get a snapshot and subscribe to updates). FYI @Marenz as you implemented this in dispatch.  | 
  
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The
ComponentStatusenum is used only in theComponentmessage.The gRPC APIs that use the
Componentmessage only use it in simple RPCs (e.g. here). This means that clients can pick up updates to theComponentStatusfield only via polling, instead of streaming. This could lead to instances where clients do not notice the update after long delays, or not at all.Let's assume that
ComponentStatusexists in the streaming data output. Then, as soon as it changes toINACTIVE, we will stop reading data form the component. This will result in no further data in the output stream. This, in turn, means that clients won;t be updated about theComponentStatuschanging toINACTIVE. This means that theComponentStatusfield has to exist in theComponentmessage, where it can always be polled.This still does not mean that
ComponentStatuscannot be streamed, given future context. We are internally deciding to extend this enum to contain more states related to granular read/write abilities on the components. If a client could write to a component, and that component would suddenly becomes read-only, it might be better to stream theComponentStatusto the client, instead of the client getting an error and then polling the API to find out what's happening.So the question boils down to if API services should actively notify clients of changes in
ComponentStatus, and if yes, then how?Beta Was this translation helpful? Give feedback.
All reactions