-
Notifications
You must be signed in to change notification settings - Fork 0
/
readside.proto
43 lines (37 loc) · 1.64 KB
/
readside.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
syntax = "proto3";
package chief_of_state.v1;
import "chief_of_state/v1/common.proto";
import "google/protobuf/any.proto";
option csharp_namespace = "ChiefOfState.V1";
option go_package = "chief_of_state/v1;chiefofstatev1";
option java_multiple_files = true;
option java_outer_classname = "CosReadSideHandlerProto";
option java_package = "com.github.chiefofstate.protobuf.v1";
// Defines the readSide handler service interface that will be implemented by
// any application that needs to build a readSide from the events persisted.
// 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 snapshots
rpc HandleReadSide(HandleReadSideRequest) returns (HandleReadSideResponse);
}
// ReadSideRequest is used to push the ReadSideHandler
// events and state persisted in the journal and the snapshot
message HandleReadSideRequest {
// Specifies the persisted event
google.protobuf.Any event = 1;
// Specifies the resulting state associated to the persisted event
google.protobuf.Any state = 2;
// Specifies the additional meta data
chief_of_state.v1.MetaData meta = 3;
// Specifies the identifier of the read side service receiving the request
string read_side_id = 4;
}
// ReadSideResponse 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;
}