SignalHandle

sealed interface SignalHandle

Handle to resolve or reject a named signal on a target invocation.

Unlike awakeables, signals are identified by (invocationId, name) and do not need to be pre-registered: the resolution can arrive before or after the handler starts waiting.

Functions

Link copied to clipboard
abstract suspend fun reject(reason: String)

Reject the signal with the given reason. The handler awaiting the signal will receive a terminal error with reason as the message.

Link copied to clipboard
abstract suspend fun <T : Any> resolve(typeTag: TypeTag<T>, payload: T)

Resolve the signal with the given value.

Link copied to clipboard
inline suspend fun <T : Any> SignalHandle.resolve(payload: T)

Resolve the signal with the given value.