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

Workflow api changes #91

Merged
merged 6 commits into from
May 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
54 changes: 54 additions & 0 deletions dev/restate/service/protocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,60 @@ message GetStateKeysEntryMessage {
string name = 12;
}

// Completable: Yes
// Fallible: No
// Type: 0x0800 + 8
message GetPromiseEntryMessage {
string key = 1;

oneof result {
bytes value = 14;
Failure failure = 15;
};

// Entry name
string name = 12;
}

// Completable: Yes
// Fallible: No
// Type: 0x0800 + 9
message PeekPromiseEntryMessage {
string key = 1;

oneof result {
Empty empty = 13;
bytes value = 14;
Failure failure = 15;
};

// Entry name
string name = 12;
}

// Completable: Yes
// Fallible: No
// Type: 0x0800 + A
message CompletePromiseEntryMessage {
string key = 1;

// The value to use to complete the promise
oneof completion {
bytes completion_value = 2;
Failure completion_failure = 3;
};

oneof result {
// Returns empty if value was set successfully
Empty empty = 13;
// Returns a failure if the promise was already completed
Failure failure = 15;
}

// Entry name
string name = 12;
}

// ------ Syscalls ------

// Completable: Yes
Expand Down
6 changes: 3 additions & 3 deletions endpoint_manifest_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"ty": {
"title": "ServiceType",
"enum": ["VIRTUAL_OBJECT", "SERVICE"]
"enum": ["VIRTUAL_OBJECT", "SERVICE", "WORKFLOW"]
},
"handlers": {
"type": "array",
Expand All @@ -45,8 +45,8 @@
},
"ty": {
"title": "HandlerType",
"enum": ["EXCLUSIVE", "SHARED"],
"description": "If unspecified, defaults to EXCLUSIVE for Virtual Object. This should be unset for Services."
"enum": ["WORKFLOW", "EXCLUSIVE", "SHARED"],
"description": "If unspecified, defaults to EXCLUSIVE for Virtual Object or WORKFLOW for Workflows. This should be unset for Services."
},
"input": {
"type": "object",
Expand Down
3 changes: 3 additions & 0 deletions service-invocation-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ descriptions in [`protocol.proto`](dev/restate/service/protocol.proto).
| `ClearStateEntryMessage` | `0x0801` | No | No | Clear the value of a service instance state key. |
| `ClearAllStateEntryMessage` | `0x0802` | No | No | Clear all the values of the service instance state. |
| `RunEntryMessage` | `0x0C05` | No | No | Run non-deterministic user provided code and persist the result. |
| `GetPromiseEntryMessage` | `0x0808` | Yes | No | Get or wait the value of the given promise. If the value is not present yet, this entry will block waiting for the value. |
| `PeekPromiseEntryMessage` | `0x0809` | Yes | No | Get the value of the given promise. If the value is not present, this entry completes immediately with empty completion. |
| `CompletePromiseEntryMessage` | `0x080A` | Yes | No | Complete the given promise. If the promise was completed already, this entry completes with a failure. |

#### Awakeable identifier

Expand Down
Loading