You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`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. |
286
286
|`GetStateEntryMessage`|`0x0800`| Yes | No | Get the value of a service instance state key. |
287
+
|`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`. |
287
288
|`SleepEntryMessage`|`0x0C00`| Yes | No | Initiate a timer that completes after the given time. |
288
289
|`InvokeEntryMessage`|`0x0C01`| Yes | Yes | Invoke another Restate service. |
289
290
|`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. |
@@ -292,18 +293,22 @@ descriptions in [`protocol.proto`](dev/restate/service/protocol.proto).
292
293
|`OutputStreamEntryMessage`|`0x0401`| No | No | Carries the invocation output message(s) or terminal failure of the invocation. |
293
294
|`SetStateEntryMessage`|`0x0800`| No | No | Set the value of a service instance state key. |
294
295
|`ClearStateEntryMessage`|`0x0801`| No | No | Clear the value of a service instance state key. |
296
+
|`ClearAllStateEntryMessage`|`0x0802`| No | No | Clear all the values of the service instance state. |
295
297
296
298
#### Awakeable identifier
297
299
298
300
When creating an `AwakeableEntryMessage`, the SDK MUST expose to the user code an id, required to later complete the
299
301
entry, using either `CompleteAwakeableEntryMessage` or some other mechanism provided by the runtime.
300
302
301
-
The id format is a [Base64 URL Safe string](https://datatracker.ietf.org/doc/html/rfc4648#section-5) encoding a byte
302
-
array that concatenates:
303
+
The id format is a string starts with `prom_1` concatenated with a
304
+
[Base64 URL Safe string](https://datatracker.ietf.org/doc/html/rfc4648#section-5) encoding of a byte array that
305
+
concatenates:
303
306
304
307
-`StartMessage.id`
305
308
- The index of the Awakeable entry, encoded as unsigned 32 bit integer big endian.
306
309
310
+
An example of a valid identifier would look like `prom_1NMyOAvDK2CcBjUH4Rmb7eGBp0DNNDnmsAAAAAQ`
311
+
307
312
## Suspension
308
313
309
314
As mentioned in [Replaying and processing](#replaying-and-processing), an invocation can be suspended while waiting for
@@ -329,8 +334,8 @@ To notify a failure, the SDK can either:
329
334
330
335
- Close the stream with `ErrorMessage` as last message. This message is used by the runtime for accurate reporting to
331
336
the user.
332
-
- Close the stream without `EndMessage` or `SuspensionMessage` or `ErrorMessage`. This is equivalent to sending
333
-
an `ErrorMessage` with unknown reason.
337
+
- Close the stream without `EndMessage` or `SuspensionMessage` or `ErrorMessage`. This is equivalent to sending an
338
+
`ErrorMessage` with unknown reason.
334
339
335
340
The runtime takes care of retrying to execute the invocation after such failures occur, following a defined set of
336
341
policies. When retrying, the previous stored journal will be reused. Moreover, the SDK MUST NOT assume that every
@@ -398,5 +403,5 @@ A possible implementation could be the following. Given a user requests a state
398
403
- If `partial_state` is set, generate a `GetStateEntryMessage` without a `result`, and wait for the runtime to send a
399
404
`Completion` back (same logic as without eager state)
400
405
401
-
In order for the aforementioned algorithm to work, setand clear state operations must be reflected on the local
402
-
`state_map` as well.
406
+
In order for the aforementioned algorithm to work, set, clear and clear all state operations must be reflected on the
0 commit comments