@@ -67,6 +67,9 @@ service MicrogridDispatchService {
6767 // Returns a list of all dispatches
6868 rpc ListMicrogridDispatches (ListMicrogridDispatchesRequest ) returns (ListMicrogridDispatchesResponse );
6969
70+ // Streaming RPC for receiving dispatch updates for a given microgrid
71+ rpc StreamMicrogridDispatches (StreamMicrogridDispatchesRequest ) returns (stream StreamMicrogridDispatchesResponse );
72+
7073 // Create a new dispatch
7174 rpc CreateMicrogridDispatch (CreateMicrogridDispatchRequest ) returns (CreateMicrogridDispatchResponse );
7275
@@ -80,6 +83,38 @@ service MicrogridDispatchService {
8083 rpc DeleteMicrogridDispatch (DeleteMicrogridDispatchRequest ) returns (DeleteMicrogridDispatchResponse );
8184}
8285
86+ // Subscribe to a stream of microgrid dispatch requests.
87+ // This method provides real-time updates on newly or updated dispatch requests for edge-based
88+ // realtime decision making.
89+ message StreamMicrogridDispatchesRequest {
90+ // ID of the microgrid to subscribe to
91+ uint64 microgrid_id = 1 ;
92+ }
93+
94+ // Response to a subscription request for a stream of microgrid dispatches.
95+ // Real-time information on dispatches affecting a certain microgrid are pushed through this response.
96+ message StreamMicrogridDispatchesResponse {
97+ enum Event {
98+ // Default, unspecified event
99+ EVENT_UNSPECIFIED = 0 ;
100+
101+ // A new dispatch has been created
102+ EVENT_CREATED = 1 ;
103+
104+ // An existing dispatch has been updated
105+ EVENT_UPDATED = 2 ;
106+
107+ // An existing dispatch has been deleted
108+ EVENT_DELETED = 3 ;
109+ }
110+
111+ // Dispatch record returned.
112+ DispatchDetail dispatch_detail = 1 ;
113+
114+ // Which event this response was triggered by
115+ Event event = 2 ;
116+ }
117+
83118// Represents a dispatches data, including its type, start time, duration, component selector,
84119//
85120// Timezone Note: Timestamps are in UTC. It is the responsibility of each microgrid to translate UTC
0 commit comments