Package dev.restate.sdk
Class Awakeable<T>
java.lang.Object
dev.restate.sdk.DurableFuture<T>
dev.restate.sdk.Awakeable<T>
An
Awakeable
is a special type of DurableFuture
which can be arbitrarily
completed by another service, by addressing it with its id()
.
It can be used to let a service wait on a specific condition/result, which is fulfilled by another service or by an external system at a later point in time.
For example, you can send a Kafka record including the id()
, and then let
another service consume from Kafka the responses of given external system interaction by using
Context.awakeableHandle(String)
.
NOTE: This interface MUST NOT be accessed concurrently since it can lead to different orderings of user actions, corrupting the execution of the invocation.
-
Method Summary
Methods inherited from class dev.restate.sdk.DurableFuture
all, all, any, any, await, await, map, map, mapFailure, withTimeout
-
Method Details
-
id
- Returns:
- the unique identifier of this
Awakeable
instance.
-
asyncResult
- Specified by:
asyncResult
in classDurableFuture<T>
-
serviceExecutor
- Specified by:
serviceExecutor
in classDurableFuture<T>
-