Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readside streaming #25

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions chief_of_state/v1/readside.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ import "google/protobuf/any.proto";
// ChiefOfState will connect to this service when the readSide is enabled and
// push events to it.
service ReadSideHandlerService {
// Helps build a read model from persisted events and snpahots
rpc HandleReadSide(HandleReadSideRequest) returns (HandleReadSideResponse);
// Helps build a read model from persisted events and snapshots
rpc HandleReadSide(HandleReadSideRequest) returns (HandleReadSideResponse){}
// Send a sequence of events and snapshots to be processed to build a read model.
rpc HandleReadSideStream (stream HandleReadSideStreamRequest) returns (HandleReadSideStreamResponse){}
}

// ReadSideRequest is used to push the ReadSideHandler
// HandleReadSideRequest is used to push the ReadSideHandler
// events and state persisted in the journal and the snapshot
message HandleReadSideRequest {
// the persisted event
Expand All @@ -33,10 +35,32 @@ message HandleReadSideRequest {
string read_side_id = 4;
}

// ReadSideResponse is used by ChiefOfState to either
// HandleReadSideResponses is used by ChiefOfState to either
// commit events read offset or not.
message HandleReadSideResponse {
// successful=true means the offset will be committed and the readside will move on to process the next event.
// Otherwise, if successful=false, the event will get reprocessed with a backoff strategy.
bool successful = 1;
}


// HandleReadSideStreamRequest is used to push the ReadSideHandler
// events and state persisted in the journal and the snapshot
message HandleReadSideStreamRequest {
// the persisted event
google.protobuf.Any event = 1;
// the resulting state associated to the persisted event
google.protobuf.Any state = 2;
// additional meta data
chief_of_state.v1.MetaData meta = 3;
// the identifier of the read side service receiving the request
string read_side_id = 4;
}

// HandleReadSideStreamResponse is used by ChiefOfState to either
// commit events read offset or not.
message HandleReadSideStreamResponse {
// successful=true means the offset will be committed and the readside will move on to process the next event.
// Otherwise, if successful=false, the event will get reprocessed with a backoff strategy.
bool successful = 1;
}