diff --git a/dev/restate/core.proto b/dev/restate/core.proto deleted file mode 100644 index 7c2fe8f..0000000 --- a/dev/restate/core.proto +++ /dev/null @@ -1,17 +0,0 @@ -/* - This package provides core user facing Restate types - */ -syntax = "proto3"; - -package dev.restate.core; - -option java_multiple_files = true; -option java_package = "dev.restate.generated.core"; -option go_package = "restate.dev/sdk-go/pb/core"; - -message AwakeableIdentifier { - string service_name = 1; - bytes instance_key = 2; - bytes invocation_id = 3; - uint32 entry_index = 4; -} \ No newline at end of file diff --git a/dev/restate/services.proto b/dev/restate/services.proto index ee2652d..174b164 100644 --- a/dev/restate/services.proto +++ b/dev/restate/services.proto @@ -5,6 +5,9 @@ syntax = "proto3"; package dev.restate; +import "google/protobuf/empty.proto"; +import "google/protobuf/struct.proto"; + option java_multiple_files = true; option java_package = "dev.restate.generated"; option go_package = "restate.dev/sdk-go/pb"; @@ -32,4 +35,32 @@ message InvokeResponse { // Generated unique invocation identifier. // It can be used to retrieve the status of the invocation and cancel it. string sid = 1; +} + +service Awakeables { + // Resolve an Awakeable with a result value. + rpc Resolve(ResolveAwakeableRequest) returns (google.protobuf.Empty); + // Reject an Awakeable with a reason. + rpc Reject(RejectAwakeableRequest) returns (google.protobuf.Empty); +} + +message ResolveAwakeableRequest { + // Base64 encoded identifier of the Awakeable to resolve. + string id = 1; + + oneof result { + bytes bytes_result = 2; + + // When executing requests to the ingress using JSON, you can pass a json_result directly for ease of use. + // json_result will be sent back to the awakeable as string encoded JSON, not as Protobuf value. + google.protobuf.Value json_result = 3; + } +} + +message RejectAwakeableRequest { + // Base64 encoded identifier of the Awakeable to reject. + string id = 1; + + // Rejection reason. + string reason = 2; } \ No newline at end of file