awakeable

inline suspend fun <T : Any> Context.awakeable(): Awakeable<T>

Create an Awakeable, addressable through Awakeable.id.

You can use this feature to implement external asynchronous systems interactions, 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 awakeableHandle.

Return

the Awakeable to await on.

See also


@ApiStatus.Experimental
inline suspend fun <T : Any> awakeable(): Awakeable<T>

Create an Awakeable, addressable through Awakeable.id.

Return

the Awakeable to await on.

See also

Throws

if called outside of a Restate handler


@ApiStatus.Experimental
suspend fun <T : Any> awakeable(typeTag: TypeTag<T>): Awakeable<T>

Create an Awakeable, addressable through Awakeable.id.

You can use this feature to implement external asynchronous systems interactions, 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 awakeableHandle.

Return

the Awakeable to await on.

Parameters

typeTag

the type tag for deserializing the Awakeable result.

See also