Skip to content

Commit

Permalink
Move headers into InputStreamEntry. (#75)
Browse files Browse the repository at this point in the history
Make PollInputStreamEntry non-completable and remove streaming concepts.
  • Loading branch information
slinkydeveloper authored Mar 18, 2024
1 parent 433d446 commit 4378d55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
17 changes: 7 additions & 10 deletions dev/restate/service/protocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ message StartMessage {
repeated StateEntry state_map = 4;
bool partial_state = 5;

repeated Header headers = 6;

// If this invocation has a key associated (e.g. for objects and workflows), then this key is filled in. Empty otherwise.
string key = 7;
string key = 6;
}

// Type: 0x0000 + 1
Expand Down Expand Up @@ -106,20 +104,19 @@ message EndMessage {

// ------ Input and output ------

// Completable: Yes
// Completable: No
// Fallible: No
// Type: 0x0400 + 0
message PollInputStreamEntryMessage {
oneof result {
bytes value = 14;
Failure failure = 15;
}
message InputEntryMessage {
repeated Header headers = 1;

bytes value = 14;
}

// Completable: No
// Fallible: No
// Type: 0x0400 + 1
message OutputStreamEntryMessage {
message OutputEntryMessage {
oneof result {
bytes value = 14;
Failure failure = 15;
Expand Down
4 changes: 2 additions & 2 deletions service-invocation-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,15 @@ descriptions in [`protocol.proto`](dev/restate/service/protocol.proto).

| Message | Type | Completable | Fallible | Description |
| ------------------------------- | -------- | ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PollInputStreamEntryMessage` | `0x0400` | Yes | No | Carries the invocation input message(s) of the invocation. Note: currently the runtime always sends this entry completed, but this may change in future. |
| `InputEntryMessage` | `0x0400` | No | No | Carries the invocation input message(s) of the invocation. |
| `GetStateEntryMessage` | `0x0800` | Yes | No | Get the value of a service instance state key. |
| `GetStateKeysEntryMessage` | `0x0804` | Yes | No | Get all the known state keys for this service instance. Note: the completion value for this message is a protobuf of type `GetStateKeysEntryMessage.StateKeys`. |
| `SleepEntryMessage` | `0x0C00` | Yes | No | Initiate a timer that completes after the given time. |
| `InvokeEntryMessage` | `0x0C01` | Yes | Yes | Invoke another Restate service. |
| `AwakeableEntryMessage` | `0x0C03` | Yes | No | Arbitrary result container which can be completed from another service, given a specific id. See [Awakeable identifier](#awakeable-identifier) for more details. |
| `BackgroundInvokeEntryMessage` | `0x0C02` | No | Yes | Invoke another Restate service at the given time, without waiting for the response. |
| `CompleteAwakeableEntryMessage` | `0x0C04` | No | Yes | Complete an `Awakeable`, given its id. See [Awakeable identifier](#awakeable-identifier) for more details. |
| `OutputStreamEntryMessage` | `0x0401` | No | No | Carries the invocation output message(s) or terminal failure of the invocation. |
| `OutputEntryMessage` | `0x0401` | No | No | Carries the invocation output message(s) or terminal failure of the invocation. |
| `SetStateEntryMessage` | `0x0800` | No | No | Set the value of a service instance state key. |
| `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. |
Expand Down

0 comments on commit 4378d55

Please sign in to comment.