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
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 RunCompleter
Link copied to clipboard
interface UnresolvedFuture
Node of a future tree, awaited with await.
Functions
Link copied to clipboard
abstract fun attachInvocation(invocationId: String): CompletableFuture<HandlerContext.Handle<Slice>>
Link copied to clipboard
Restate-protocol-level HTTP headers received on the current invocation attempt.
Link copied to clipboard
abstract fun await(tree: HandlerContext.UnresolvedFuture): CompletableFuture<HandlerContext.AwaitResult>
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
Link copied to clipboard
Link copied to clipboard
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 getInvocationOutput(invocationId: String): CompletableFuture<HandlerContext.Handle<Output<Slice>>>
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 rejectPromise(key: String, reason: TerminalException): CompletableFuture<HandlerContext.Handle<Void>>
Link copied to clipboard
abstract fun rejectSignal(invocationId: String, name: String, reason: TerminalException): CompletableFuture<Void>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun resolvePromise(key: String, payload: Slice): CompletableFuture<HandlerContext.Handle<Void>>
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
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