Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttachInvocation and GetInvocationOutput entries #99

Merged
merged 1 commit into from
Nov 15, 2024
Merged
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
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 {
bytes 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;
bytes 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
Loading