Package dev.restate.sdk.testing
Class RestateRunnerBuilder
- java.lang.Object
-
- dev.restate.sdk.testing.RestateRunnerBuilder
-
public class RestateRunnerBuilder extends java.lang.ObjectBuilder forRestateRunner. SeeRestateRunnerfor more details.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ManualRestateRunnerbuildManualRunner()RestateRunnerbuildRunner()static RestateRunnerBuildercreate()static RestateRunnerBuilderof(dev.restate.sdk.http.vertx.RestateHttpEndpointBuilder endpointBuilder)Create fromRestateHttpEndpointBuilder.RestateRunnerBuilderwith(java.lang.Object service)Add a Restate service to the endpoint.RestateRunnerBuilderwith(java.lang.Object service, java.util.concurrent.Executor executor)Add a Restate service to the endpoint, specifying theexecutorwhere to run the service code.<T> RestateRunnerBuilderwith(T service, dev.restate.sdk.common.ComponentAdapter<T> adapter)Add a Restate service to the endpoint, specifying an adapter.<T> RestateRunnerBuilderwith(T service, dev.restate.sdk.common.ComponentAdapter<T> adapter, java.util.concurrent.Executor executor)Add a Restate service to the endpoint, specifying theexecutorwhere to run the service code.RestateRunnerBuilderwithAdditionalEnv(java.lang.String key, java.lang.String value)Add additional environment variables to the Restate container.RestateRunnerBuilderwithConfigFile(java.lang.String configFile)Mount a config file in the Restate container.RestateRunnerBuilderwithRestateContainerImage(java.lang.String restateContainerImage)Override the container image to use for the Restate runtime.RestateRunnerBuilderwithService(dev.restate.sdk.common.BlockingComponent service, io.grpc.ServerInterceptor... interceptors)Register a service.RestateRunnerBuilderwithService(dev.restate.sdk.common.BlockingComponent service, java.util.concurrent.Executor executor, io.grpc.ServerInterceptor... interceptors)Register a service.RestateRunnerBuilderwithService(dev.restate.sdk.common.NonBlockingComponent service, io.grpc.ServerInterceptor... interceptors)Register a service.
-
-
-
Method Detail
-
withRestateContainerImage
public RestateRunnerBuilder withRestateContainerImage(java.lang.String restateContainerImage)
Override the container image to use for the Restate runtime.
-
withAdditionalEnv
public RestateRunnerBuilder withAdditionalEnv(java.lang.String key, java.lang.String value)
Add additional environment variables to the Restate container.
-
withConfigFile
public RestateRunnerBuilder withConfigFile(java.lang.String configFile)
Mount a config file in the Restate container.
-
withService
public RestateRunnerBuilder withService(dev.restate.sdk.common.BlockingComponent service, io.grpc.ServerInterceptor... interceptors)
Register a service. SeeRestateHttpEndpointBuilder.withService(BlockingComponent, ServerInterceptor...).
-
withService
public RestateRunnerBuilder withService(dev.restate.sdk.common.BlockingComponent service, java.util.concurrent.Executor executor, io.grpc.ServerInterceptor... interceptors)
Register a service. SeeRestateHttpEndpointBuilder.withService(BlockingComponent, Executor, ServerInterceptor...).
-
withService
public RestateRunnerBuilder withService(dev.restate.sdk.common.NonBlockingComponent service, io.grpc.ServerInterceptor... interceptors)
Register a service. SeeRestateHttpEndpointBuilder.withService(NonBlockingComponent, ServerInterceptor...).
-
with
public RestateRunnerBuilder with(java.lang.Object service)
Add a Restate service to the endpoint. This will automatically discover the adapter based on the class name. You can provide the adapter manually usingwith(Object, ComponentAdapter)
-
with
public RestateRunnerBuilder with(java.lang.Object service, java.util.concurrent.Executor executor)
Add a Restate service to the endpoint, specifying theexecutorwhere to run the service code. This will automatically discover the adapter based on the class name. You can provide the adapter manually usingwith(Object, ComponentAdapter, Executor)You can run on virtual threads by using the executor
Executors.newVirtualThreadPerTaskExecutor().
-
with
public <T> RestateRunnerBuilder with(T service, dev.restate.sdk.common.ComponentAdapter<T> adapter)
Add a Restate service to the endpoint, specifying an adapter.
-
with
public <T> RestateRunnerBuilder with(T service, dev.restate.sdk.common.ComponentAdapter<T> adapter, java.util.concurrent.Executor executor)
Add a Restate service to the endpoint, specifying theexecutorwhere to run the service code.You can run on virtual threads by using the executor
Executors.newVirtualThreadPerTaskExecutor().
-
buildManualRunner
public ManualRestateRunner buildManualRunner()
-
buildRunner
public RestateRunner buildRunner()
-
create
public static RestateRunnerBuilder create()
-
of
public static RestateRunnerBuilder of(dev.restate.sdk.http.vertx.RestateHttpEndpointBuilder endpointBuilder)
Create fromRestateHttpEndpointBuilder.
-
-