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 record
static final record
static interface
-
Method Summary
Modifier and TypeMethodDescriptionattachInvocation
(String invocationId) call
(Target target, Slice parameter, @Nullable String idempotencyKey, @Nullable Collection<Map.Entry<String, String>> headers) cancelInvocation
(String invocationId) clearAll()
createAllAsyncResult
(List<AsyncResult<?>> children) createAnyAsyncResult
(List<AsyncResult<?>> children) void
getInvocationOutput
(String invocationId) getKeys()
peekPromise
(String key) rejectAwakeable
(String id, TerminalException reason) rejectPromise
(String key, TerminalException reason) request()
resolveAwakeable
(String id, Slice payload) resolvePromise
(String key, Slice payload) send
(Target target, Slice parameter, @Nullable String idempotencyKey, @Nullable Collection<Map.Entry<String, String>> headers, @Nullable Duration delay) submitRun
(@Nullable String name, Consumer<HandlerContext.RunCompleter> closure) writeOutput
(Slice value) writeOutput
(TerminalException exception)
-
Method Details
-
objectKey
String objectKey() -
request
HandlerRequest request() -
writeOutput
-
writeOutput
-
get
-
getKeys
CompletableFuture<AsyncResult<Collection<String>>> getKeys() -
clear
-
clearAll
CompletableFuture<Void> clearAll() -
set
-
timer
-
call
CompletableFuture<HandlerContext.CallResult> call(Target target, Slice parameter, @Nullable String idempotencyKey, @Nullable Collection<Map.Entry<String, String>> headers) -
send
CompletableFuture<AsyncResult<String>> send(Target target, Slice parameter, @Nullable String idempotencyKey, @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
-
cancelInvocation
-
attachInvocation
-
getInvocationOutput
-
fail
-
createAnyAsyncResult
-
createAllAsyncResult
-