CallDurableFuture

sealed interface CallDurableFuture<T> : DurableFuture<T>

The DurableFuture returned by a Context.call.

Properties

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

Clause for select operator.

Functions

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

Wait for this DurableFuture to complete.

abstract suspend fun await(duration: Duration): T

Same as await but throws a dev.restate.sdk.common.TimeoutException if this DurableFuture doesn't complete before the provided timeout.

Link copied to clipboard
abstract suspend fun invocationId(): String

Get the invocation id of this call.

Link copied to clipboard
abstract suspend fun <R> map(transform: suspend (value: T) -> R): DurableFuture<R>

Map the success result of this DurableFuture.

abstract suspend fun <R> map(transformSuccess: suspend (value: T) -> R, transformFailure: suspend (exception: TerminalException) -> R): DurableFuture<R>

Map both the success and the failure result of this DurableFuture.

Link copied to clipboard
abstract suspend fun mapFailure(transform: suspend (exception: TerminalException) -> T): DurableFuture<T>

Map the failure result of this DurableFuture.

Link copied to clipboard
abstract suspend fun withTimeout(duration: Duration): DurableFuture<T>

Creates a DurableFuture that throws a dev.restate.sdk.common.TimeoutException if this future doesn't complete before the provided timeout.