Awakeable

sealed interface Awakeable<T> : Awaitable<T>

An Awakeable is a special type of Awaitable 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 Awakeable.id, and then let another service consume from Kafka the responses of given external system interaction by using RestateContext.awakeableHandle.

Properties

Link copied to clipboard
abstract val id: String

The unique identifier of this Awakeable instance.

Link copied to clipboard
abstract val onAwait: SelectClause<T>

Clause for select operator.

Functions

Link copied to clipboard
abstract suspend fun await(): T