Skip to content

Commit

Permalink
Merge pull request #24 from code0-tech/22-remove-flow-get
Browse files Browse the repository at this point in the history
Remove flow-get request and rework update stream
  • Loading branch information
Taucher2003 authored Dec 28, 2024
2 parents 1c4e82a + 2e91327 commit b58761f
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions proto/sagittarius/flow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ message Flow {
FlowDefinition definition = 3;
}

enum FlowCommandType {
INSERT = 0;
DELETE = 1;
message Flows {
repeated Flow flows = 1;
}

//Aquila sends a request to initialise stream to Sagittarius
Expand All @@ -24,25 +23,16 @@ message FlowLogonRequest {

//Sagittarius sends flow to be updated
message FlowResponse {
optional Flow updated_flow = 1;
optional int64 deleted_flow_id = 2;
FlowCommandType type = 3;
}

//All ids of flows that Aquila holds
message FlowGetRequest {
repeated int64 flow_ids = 1;
}

//Sagittarius checks if he holds the flow_ids that Aquila sent
//If id is present --> sends flow
//If id is not present --> returns id to be deleted
message FlowGetResponse {
repeated Flow updated_flows = 1;
repeated int64 deleted_flow_ids = 2;
oneof data {
// Updates a single flow
Flow updated_flow = 1;
// Deletes a single flow
int64 deleted_flow_id = 2;
// Replaces all flows in Aquila (only on startup and for releases)
Flows flows = 3;
}
}

service FlowService {
rpc Get (FlowGetRequest) returns (FlowGetResponse) {}
rpc Update (FlowLogonRequest) returns (stream FlowResponse) {}
}

0 comments on commit b58761f

Please sign in to comment.