Skip to content
This repository was archived by the owner on Mar 16, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions protocols/protocol/cloudstate/crdt.proto
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ message CrdtReply {
// and a CrdtStreamCancelled message will be sent if the stream is cancelled (though
// not if the a CrdtStreamedMessage ends the stream first).
bool streamed = 6;

repeated Metadata metadata = 7; // FIXME Should we rely on client_action Reply's metadata instead?
}

message CrdtStateAction {
Expand Down
54 changes: 34 additions & 20 deletions protocols/protocol/cloudstate/entity.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,18 @@ option go_package = "cloudstate/protocol";
message Reply {
// The reply payload
google.protobuf.Any payload = 1;

// The reply metadata
repeated Metadata metadata = 2;
}

// Forwards handling of this request to another entity.
message Forward {
// The name of the service to forward to.
string service_name = 1;
// The name of the command.
string command_name = 2;
// The payload.
google.protobuf.Any payload = 3;

// The call to forward to that service
Call call = 2;
}

// An action for the client
Expand All @@ -64,15 +66,8 @@ message SideEffect {
// The name of the service to perform the side effect on.
string service_name = 1;

// The name of the command.
string command_name = 2;

// The payload of the command.
google.protobuf.Any payload = 3;

// Whether this side effect should be performed synchronously, ie, before the reply is eventually
// sent, or not.
bool synchronous = 4;
// The call to make on the service
Call call = 2;
}

// A command. For each command received, a reply must be sent with a matching command id.
Expand All @@ -81,17 +76,36 @@ message Command {
// The ID of the entity.
string entity_id = 1;

// A command id.
// A command identifier, to be used for correlation and deduplication purposes
int64 id = 2;

// Command name
string name = 3;
// The Call to make on the entity
Call call = 3;
}

// A Call describes what endpoint, what payload, and what metadata to provide
message Call {

// The name of the endpoint
string name = 1;

// The payload of the endpoint
google.protobuf.Any payload = 2;

// Whether or not to stream the response
bool streamed = 3;

// The metadata / headers to send with the call
repeated Metadata metadata = 4;
}

// The command payload.
google.protobuf.Any payload = 4;
// This Metadata construct should obey the exact same rules as traditional gRPC Metadata
message Metadata {
// The name of this piece of metadata
string name = 1;

// Whether the command is streamed or not
bool streamed = 5;
// The value of the metadata
string value = 2;
}

message StreamCancelled {
Expand Down
9 changes: 3 additions & 6 deletions protocols/protocol/cloudstate/function.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@ option go_package = "cloudstate/protocol";

message FunctionCommand {
// The name of the service this function is on.
string service_name = 2;
string service_name = 2; // TODO revisit this ordinal value

// Command name
string name = 3;

// The command payload.
google.protobuf.Any payload = 4;
// The call to make to that service
Call call = 5; // TODO revisit this ordinal value
}

message FunctionReply {
Expand Down
7 changes: 2 additions & 5 deletions proxy/core/src/main/proto/cloudstate/proxy/statemanager.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,12 @@ option (scalapb.options) = {
};

message UserFunctionCommand {
string name = 1;
google.protobuf.Any payload = 2;
Call call = 1;
}

message EntityCommand {
string entity_id = 1;
string name = 2;
google.protobuf.Any payload = 3;
bool streamed = 4;
Call call = 2;
}

message UserFunctionReply {
Expand Down