Skip to content

Commit

Permalink
AttachInvocation and GetInvocationOutput entries
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper committed Nov 11, 2024
1 parent 9edfcd6 commit daa5be0
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
60 changes: 60 additions & 0 deletions dev/restate/service/protocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
}
2 changes: 2 additions & 0 deletions service-invocation-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit daa5be0

Please sign in to comment.