Package dev.restate.sdk
Class HandlerRunner<REQ,RES>
java.lang.Object
dev.restate.sdk.HandlerRunner<REQ,RES>
- All Implemented Interfaces:
HandlerRunner<REQ,
RES>
Adapter class for
HandlerRunner
to use the Java API.-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface dev.restate.sdk.endpoint.definition.HandlerRunner
HANDLER_CONTEXT_THREAD_LOCAL
-
Method Summary
Modifier and TypeMethodDescriptionstatic <CTX extends Context,
REQ>
HandlerRunner<REQ, Void> of
(ThrowingBiConsumer<CTX, REQ> runner, SerdeFactory contextSerdeFactory, @Nullable HandlerRunner.Options options) Factory method forHandlerRunner
, used by codegenstatic <CTX extends Context,
REQ, RES>
HandlerRunner<REQ, RES> of
(ThrowingBiFunction<CTX, REQ, RES> runner, SerdeFactory contextSerdeFactory, @Nullable HandlerRunner.Options options) Factory method forHandlerRunner
, used by codegenstatic <CTX extends Context>
HandlerRunner<Void, Void> of
(ThrowingConsumer<CTX> runner, SerdeFactory contextSerdeFactory, @Nullable HandlerRunner.Options options) Factory method forHandlerRunner
, used by codegenstatic <CTX extends Context,
RES>
HandlerRunner<Void, RES> of
(ThrowingFunction<CTX, RES> runner, SerdeFactory contextSerdeFactory, @Nullable HandlerRunner.Options options) Factory method forHandlerRunner
, used by codegenrun
(HandlerContext handlerContext, Serde<REQ> requestSerde, Serde<RES> responseSerde, AtomicReference<Runnable> onClosedInvocationStreamHook)
-
Method Details
-
run
public CompletableFuture<Slice> run(HandlerContext handlerContext, Serde<REQ> requestSerde, Serde<RES> responseSerde, AtomicReference<Runnable> onClosedInvocationStreamHook) - Specified by:
run
in interfaceHandlerRunner<REQ,
RES>
-
of
public static <CTX extends Context,REQ, HandlerRunner<REQ,RES> RES> of(ThrowingBiFunction<CTX, REQ, RES> runner, SerdeFactory contextSerdeFactory, @Nullable HandlerRunner.Options options) Factory method forHandlerRunner
, used by codegen -
of
public static <CTX extends Context,RES> HandlerRunner<Void,RES> of(ThrowingFunction<CTX, RES> runner, SerdeFactory contextSerdeFactory, @Nullable HandlerRunner.Options options) Factory method forHandlerRunner
, used by codegen -
of
public static <CTX extends Context,REQ> HandlerRunner<REQ,Void> of(ThrowingBiConsumer<CTX, REQ> runner, SerdeFactory contextSerdeFactory, @Nullable HandlerRunner.Options options) Factory method forHandlerRunner
, used by codegen -
of
public static <CTX extends Context> HandlerRunner<Void,Void> of(ThrowingConsumer<CTX> runner, SerdeFactory contextSerdeFactory, @Nullable HandlerRunner.Options options) Factory method forHandlerRunner
, used by codegen
-