Package dev.restate.client
Interface Client
- All Known Implementing Classes:
BaseClient,JdkClient
public interface Client
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThis class represents a handle to an Awakeable.static interfacestatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionCreate a newClient.AwakeableHandlefor the provided identifier.default <Req,Res> Response <Res> Call a service and wait for the response.<Req,Res> CompletableFuture <Response<Res>> Future version ofcall(Request)static ClientCreate a default JDK client.static Clientconnect(String baseUri, RequestOptions options) Create a default JDK client.static Clientconnect(String baseUri, SerdeFactory serdeFactory) Create a default JDK client.static Clientconnect(String baseUri, SerdeFactory serdeFactory, RequestOptions options) Create a default JDK client.<Res> Client.IdempotentInvocationHandle<Res> idempotentInvocationHandle(Target target, String idempotencyKey, TypeTag<Res> resTypeTag) Create a newClient.IdempotentInvocationHandlefor the provided target and idempotency key.default <Res> Client.IdempotentInvocationHandle<Res> idempotentInvocationHandle(Target target, String idempotencyKey, Class<Res> clazz) Create a newClient.IdempotentInvocationHandlefor the provided target and idempotency key.<Res> Client.InvocationHandle<Res> invocationHandle(String invocationId, TypeTag<Res> resTypeTag) Create a newClient.InvocationHandlefor the provided invocation identifier.default <Res> Client.InvocationHandle<Res> invocationHandle(String invocationId, Class<Res> clazz) Create a newClient.InvocationHandlefor the provided invocation identifier.default <Req,Res> SendResponse <Res> Send a request to a service without waiting for the response.default <Req,Res> SendResponse <Res> Send a request to a service without waiting for the response, optionally providing an execution delay to wait for.default <Req,Res> CompletableFuture <SendResponse<Res>> Future version ofsend(Request)<Req,Res> CompletableFuture <SendResponse<Res>> Future version ofsend(Request, Duration)default <Req,Res> SendResponse <Res> submit(WorkflowRequest<Req, Res> request) Submit a workflow.default <Req,Res> SendResponse <Res> submit(WorkflowRequest<Req, Res> request, @Nullable Duration delay) Submit a workflow, optionally providing an execution delay to wait for.default <Req,Res> CompletableFuture <SendResponse<Res>> submitAsync(WorkflowRequest<Req, Res> request) Future version ofsubmit(WorkflowRequest)default <Req,Res> CompletableFuture <SendResponse<Res>> submitAsync(WorkflowRequest<Req, Res> request, @Nullable Duration delay) Future version ofsubmit(WorkflowRequest, Duration)<Res> Client.WorkflowHandle<Res> workflowHandle(String workflowName, String workflowId, TypeTag<Res> resTypeTag) Create a newClient.WorkflowHandlefor the provided workflow name and identifier.default <Res> Client.WorkflowHandle<Res> workflowHandle(String workflowName, String workflowId, Class<Res> clazz) Create a newClient.WorkflowHandlefor the provided workflow name and identifier.
-
Method Details
-
callAsync
Future version ofcall(Request)- See Also:
-
call
Call a service and wait for the response.- Throws:
IngressException
-
sendAsync
Future version ofsend(Request)- See Also:
-
send
Send a request to a service without waiting for the response.- Throws:
IngressException
-
sendAsync
<Req,Res> CompletableFuture<SendResponse<Res>> sendAsync(Request<Req, Res> request, @Nullable Duration delay) Future version ofsend(Request, Duration)- See Also:
-
send
default <Req,Res> SendResponse<Res> send(Request<Req, Res> request, @Nullable Duration delay) throws IngressExceptionSend a request to a service without waiting for the response, optionally providing an execution delay to wait for.- Throws:
IngressException
-
submitAsync
default <Req,Res> CompletableFuture<SendResponse<Res>> submitAsync(WorkflowRequest<Req, Res> request) Future version ofsubmit(WorkflowRequest)- See Also:
-
submit
default <Req,Res> SendResponse<Res> submit(WorkflowRequest<Req, Res> request) throws IngressExceptionSubmit a workflow.- Throws:
IngressException
-
submitAsync
default <Req,Res> CompletableFuture<SendResponse<Res>> submitAsync(WorkflowRequest<Req, Res> request, @Nullable Duration delay) Future version ofsubmit(WorkflowRequest, Duration)- See Also:
-
submit
default <Req,Res> SendResponse<Res> submit(WorkflowRequest<Req, Res> request, @Nullable Duration delay) throws IngressExceptionSubmit a workflow, optionally providing an execution delay to wait for.- Throws:
IngressException
-
awakeableHandle
Create a newClient.AwakeableHandlefor the provided identifier. You can use it toClient.AwakeableHandle.resolve(TypeTag, Object)orClient.AwakeableHandle.reject(String)an Awakeable from the ingress. -
invocationHandle
Create a newClient.InvocationHandlefor the provided invocation identifier.- Parameters:
invocationId- the invocation identifierresTypeTag- type tag used to deserialize the invocation result- Returns:
- the invocation handle
-
invocationHandle
Create a newClient.InvocationHandlefor the provided invocation identifier.- Parameters:
invocationId- the invocation identifierclazz- used to deserialize the invocation result- Returns:
- the invocation handle
-
idempotentInvocationHandle
<Res> Client.IdempotentInvocationHandle<Res> idempotentInvocationHandle(Target target, String idempotencyKey, TypeTag<Res> resTypeTag) Create a newClient.IdempotentInvocationHandlefor the provided target and idempotency key.- Parameters:
target- the target service/methodidempotencyKey- the idempotency keyresTypeTag- type tag used to deserialize the invocation result- Returns:
- the idempotent invocation handle
-
idempotentInvocationHandle
default <Res> Client.IdempotentInvocationHandle<Res> idempotentInvocationHandle(Target target, String idempotencyKey, Class<Res> clazz) Create a newClient.IdempotentInvocationHandlefor the provided target and idempotency key.- Parameters:
target- the target service/methodidempotencyKey- the idempotency keyclazz- used to deserialize the invocation result- Returns:
- the idempotent invocation handle
-
workflowHandle
<Res> Client.WorkflowHandle<Res> workflowHandle(String workflowName, String workflowId, TypeTag<Res> resTypeTag) Create a newClient.WorkflowHandlefor the provided workflow name and identifier.- Parameters:
workflowName- the workflow nameworkflowId- the workflow identifierresTypeTag- type tag used to deserialize the invocation result- Returns:
- the workflow handle
-
workflowHandle
default <Res> Client.WorkflowHandle<Res> workflowHandle(String workflowName, String workflowId, Class<Res> clazz) Create a newClient.WorkflowHandlefor the provided workflow name and identifier.- Parameters:
workflowName- the workflow nameworkflowId- the workflow identifierclazz- used to deserialize the workflow result- Returns:
- the workflow handle
-
connect
Create a default JDK client.- Parameters:
baseUri- uri to connect to.
-
connect
Create a default JDK client.- Parameters:
baseUri- uri to connect tooptions- default options to use in all the requests.
-
connect
Create a default JDK client.- Parameters:
baseUri- uri to connect toserdeFactory- Serde factory to use. If you're just wrapping this client in a code-generated client, you don't need to provide this parameter.
-
connect
Create a default JDK client.- Parameters:
baseUri- uri to connect toserdeFactory- Serde factory to use. If you're just wrapping this client in a code-generated client, you don't need to provide this parameter.options- default options to use in all the requests.
-