Interface HandlerContext
public interface HandlerContext
Internal interface to access Restate functionalities. Users can use the ad-hoc RestateContext
interfaces provided by the various implementations.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic final recordstatic interface -
Method Summary
Modifier and TypeMethodDescriptionattachInvocation(String invocationId) Restate-protocol-level HTTP headers received on the current invocation attempt.call(Target target, Slice parameter, @Nullable String idempotencyKey, @Nullable String limitKey, @Nullable Collection<Map.Entry<String, String>> headers) call(Target target, Slice parameter, @Nullable String idempotencyKey, @Nullable Collection<Map.Entry<String, String>> headers) Deprecated.cancelInvocation(String invocationId) booleanbooleanbooleanbooleanclearAll()createAllAsyncResult(List<AsyncResult<?>> children) createAnyAsyncResult(List<AsyncResult<?>> children) voidgetInvocationOutput(String invocationId) getKeys()peekPromise(String key) rejectAwakeable(String id, TerminalException reason) rejectPromise(String key, TerminalException reason) rejectSignal(String invocationId, String name, TerminalException reason) request()resolveAwakeable(String id, Slice payload) resolvePromise(String key, Slice payload) resolveSignal(String invocationId, String name, Slice payload) send(Target target, Slice parameter, @Nullable String idempotencyKey, @Nullable String limitKey, @Nullable Collection<Map.Entry<String, String>> headers, @Nullable Duration delay) default CompletableFuture<AsyncResult<String>> send(Target target, Slice parameter, @Nullable String idempotencyKey, @Nullable Collection<Map.Entry<String, String>> headers, @Nullable Duration delay) Deprecated.submitRun(@Nullable String name, Consumer<HandlerContext.RunCompleter> closure) writeOutput(Slice value) Deprecated, for removal: This API element is subject to removal in a future version.writeOutput(TerminalException exception) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
objectKey
String objectKey() -
request
HandlerRequest request() -
attemptHeaders
HeadersAccessor attemptHeaders()Restate-protocol-level HTTP headers received on the current invocation attempt. Differs across retries. -
canReadState
boolean canReadState() -
canWriteState
boolean canWriteState() -
canReadPromises
boolean canReadPromises() -
canWritePromises
boolean canWritePromises() -
writeOutput
Deprecated, for removal: This API element is subject to removal in a future version. -
writeOutput
Deprecated, for removal: This API element is subject to removal in a future version. -
get
-
getKeys
CompletableFuture<AsyncResult<Collection<String>>> getKeys() -
clear
-
clearAll
CompletableFuture<Void> clearAll() -
set
-
timer
-
call
@Deprecated default CompletableFuture<HandlerContext.CallResult> call(Target target, Slice parameter, @Nullable String idempotencyKey, @Nullable Collection<Map.Entry<String, String>> headers) Deprecated. -
call
CompletableFuture<HandlerContext.CallResult> call(Target target, Slice parameter, @Nullable String idempotencyKey, @Nullable String limitKey, @Nullable Collection<Map.Entry<String, String>> headers) -
send
@Deprecated default CompletableFuture<AsyncResult<String>> send(Target target, Slice parameter, @Nullable String idempotencyKey, @Nullable Collection<Map.Entry<String, String>> headers, @Nullable Duration delay) Deprecated. -
send
CompletableFuture<AsyncResult<String>> send(Target target, Slice parameter, @Nullable String idempotencyKey, @Nullable String limitKey, @Nullable Collection<Map.Entry<String, String>> headers, @Nullable Duration delay) -
submitRun
CompletableFuture<AsyncResult<Slice>> submitRun(@Nullable String name, Consumer<HandlerContext.RunCompleter> closure) -
awakeable
CompletableFuture<HandlerContext.Awakeable> awakeable() -
resolveAwakeable
-
rejectAwakeable
-
promise
-
peekPromise
-
resolvePromise
-
rejectPromise
-
signal
-
resolveSignal
-
rejectSignal
-
cancelInvocation
-
attachInvocation
-
getInvocationOutput
-
fail
-
createAnyAsyncResult
-
createAllAsyncResult
-