From daa5be0afb6b5bcb0f0463cb16c7fe805a7c1a7f Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Mon, 11 Nov 2024 11:25:00 +0100 Subject: [PATCH] AttachInvocation and GetInvocationOutput entries --- dev/restate/service/protocol.proto | 60 ++++++++++++++++++++++++++++++ service-invocation-protocol.md | 2 + 2 files changed, 62 insertions(+) diff --git a/dev/restate/service/protocol.proto b/dev/restate/service/protocol.proto index 45aa417..699d005 100644 --- a/dev/restate/service/protocol.proto +++ b/dev/restate/service/protocol.proto @@ -431,6 +431,54 @@ message GetCallInvocationIdEntryMessage { string name = 12; } +// Completable: Yes +// Fallible: Yes +// Type: 0x0C00 + 8 +message AttachInvocationEntryMessage { + oneof target { + // Target invocation id + string invocation_id = 1; + // Target index of the call/one way call journal entry in this journal. + uint32 call_entry_index = 2; + // Target idempotent request + IdempotentRequestTarget idempotent_request_target = 3; + // Target workflow target + WorkflowTarget workflow_target = 4; + } + + oneof result { + string value = 14; + Failure failure = 15; + }; + + string name = 12; +} + +// Completable: Yes +// Fallible: Yes +// Type: 0x0C00 + 9 +message GetInvocationOutputEntryMessage { + oneof target { + // Target invocation id + string invocation_id = 1; + // Target index of the call/one way call journal entry in this journal. + uint32 call_entry_index = 2; + // Target idempotent request + IdempotentRequestTarget idempotent_request_target = 3; + // Target workflow target + WorkflowTarget workflow_target = 4; + } + + oneof result { + // Empty if no result is still available + Empty empty = 13; + string value = 14; + Failure failure = 15; + }; + + string name = 12; +} + // --- Nested messages // This failure object carries user visible errors, @@ -447,5 +495,17 @@ message Header { string value = 2; } +message WorkflowTarget { + string workflow_name = 1; + string workflow_key = 2; +} + +message IdempotentRequestTarget { + string service_name = 1; + optional string service_key = 2; + string handler_name = 3; + string idempotency_key = 4; +} + message Empty { } diff --git a/service-invocation-protocol.md b/service-invocation-protocol.md index 89e23cb..1c1124e 100644 --- a/service-invocation-protocol.md +++ b/service-invocation-protocol.md @@ -350,6 +350,8 @@ descriptions in [`protocol.proto`](dev/restate/service/protocol.proto). | `CompletePromiseEntryMessage` | `0x080A` | Yes | No | Complete the given promise. If the promise was completed already, this entry completes with a failure. | | `CancelInvocationEntryMessage` | `0x0C06` | No | Yes | Cancel the target invocation id or the target journal entry. | | `GetCallInvocationIdEntryMessage` | `0x0C07` | Yes | Yes | Get the invocation id of a previously created call/one way call. | +| `AttachInvocationEntryMessage` | `0x0C08` | Yes | Yes | Attach to an existing invocation. If the invocation is still in-flight, this entry will be completed when the target invocation completes. | +| `GetInvocationOutputEntryMessage` | `0x0C09` | Yes | Yes | Get output of an existing invocation. If the invocation is still in-flight, this entry will be completed with `empty` value. | #### Awakeable identifier