HandlerContext

interface HandlerContext

Internal interface to access Restate functionalities. Users can use the ad-hoc RestateContext interfaces provided by the various implementations.

The operations producing a result return a Handle to it. To get the result, build a future tree out of the handles (UnresolvedFuture) and await it.

Types

Link copied to clipboard
interface AwaitResult
Result of await.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface Handle<T>
Opaque handle to the result of an operation, returned by the HandlerContext operations, and used to build the UnresolvedFuture.Single nodes of a future tree.
Link copied to clipboard
interface Result<T>
Result of an operation.
Link copied to clipboard
interface RunCompleter
Link copied to clipboard
Node of a future tree, awaited with await.

Functions

Link copied to clipboard
Link copied to clipboard
Restate-protocol-level HTTP headers received on the current invocation attempt.
Link copied to clipboard
Await the given future tree, until either one of its singles completes, or the invocation is cancelled or aborted.
Link copied to clipboard
Link copied to clipboard
open fun call(target: Target, parameter: Slice, @Nullable idempotencyKey: @Nullable String, @Nullable headers: @Nullable Collection<Map.Entry<String, String>>): CompletableFuture<HandlerContext.CallHandles>
abstract fun call(target: Target, parameter: Slice, @Nullable idempotencyKey: @Nullable String, @Nullable limitKey: @Nullable String, @Nullable headers: @Nullable Collection<Map.Entry<String, String>>): CompletableFuture<HandlerContext.CallHandles>
Link copied to clipboard
abstract fun cancelInvocation(invocationId: String): CompletableFuture<Void>
Link copied to clipboard
abstract fun canReadPromises(): Boolean
Link copied to clipboard
abstract fun canReadState(): Boolean
Link copied to clipboard
abstract fun canWritePromises(): Boolean
Link copied to clipboard
abstract fun canWriteState(): Boolean
Link copied to clipboard
abstract fun clear(name: String): CompletableFuture<Void>
Link copied to clipboard
Link copied to clipboard
abstract fun fail(cause: Throwable)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun objectKey(): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun rejectSignal(invocationId: String, name: String, reason: TerminalException): CompletableFuture<Void>
Link copied to clipboard
abstract fun request(): HandlerRequest
Link copied to clipboard
abstract fun resolveAwakeable(id: String, payload: Slice): CompletableFuture<Void>
Link copied to clipboard
Link copied to clipboard
abstract fun resolveSignal(invocationId: String, name: String, payload: Slice): CompletableFuture<Void>
Link copied to clipboard
open fun send(target: Target, parameter: Slice, @Nullable idempotencyKey: @Nullable String, @Nullable headers: @Nullable Collection<Map.Entry<String, String>>, @Nullable delay: @Nullable Duration): CompletableFuture<HandlerContext.Handle<String>>
abstract fun send(target: Target, parameter: Slice, @Nullable idempotencyKey: @Nullable String, @Nullable limitKey: @Nullable String, @Nullable headers: @Nullable Collection<Map.Entry<String, String>>, @Nullable delay: @Nullable Duration): CompletableFuture<HandlerContext.Handle<String>>
Link copied to clipboard
abstract fun set(name: String, value: Slice): CompletableFuture<Void>
Link copied to clipboard
Link copied to clipboard
abstract fun submitRun(@Nullable name: @Nullable String, closure: Consumer<HandlerContext.RunCompleter>): CompletableFuture<HandlerContext.Handle<Slice>>
Link copied to clipboard
abstract fun timer(duration: Duration, @Nullable name: @Nullable String): CompletableFuture<HandlerContext.Handle<Void>>
Link copied to clipboard