Package dev.restate.client.base
Class BaseClient
java.lang.Object
dev.restate.client.base.BaseClient
- All Implemented Interfaces:
Client
- Direct Known Subclasses:
JdkClient
Base client. This can be used to build
Client
implementations on top with the HTTP client
of your choice.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
protected static interface
Nested classes/interfaces inherited from interface dev.restate.client.Client
Client.AwakeableHandle, Client.IdempotentInvocationHandle<Res>, Client.InvocationHandle<Res>, Client.WorkflowHandle<Res>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseClient
(URI baseUri, @Nullable SerdeFactory serdeFactory, @Nullable RequestOptions baseOptions) -
Method Summary
Modifier and TypeMethodDescriptionCreate a newClient.AwakeableHandle
for the provided identifier.<Req,
Res> CompletableFuture <Response<Res>> protected abstract <Res> CompletableFuture
<Res> doGetRequest
(URI target, Stream<Map.Entry<String, String>> headers, BaseClient.ResponseMapper<Res> responseMapper) protected abstract <Res> CompletableFuture
<Res> doPostRequest
(URI target, Stream<Map.Entry<String, String>> headers, Slice payload, BaseClient.ResponseMapper<Res> responseMapper) <Res> Client.IdempotentInvocationHandle
<Res> idempotentInvocationHandle
(Target target, String idempotencyKey, TypeTag<Res> resTypeTag) <Res> Client.InvocationHandle
<Res> invocationHandle
(String invocationId, TypeTag<Res> resTypeTag) <Req,
Res> CompletableFuture <SendResponse<Res>> <Res> Client.WorkflowHandle
<Res> workflowHandle
(String workflowName, String workflowId, TypeTag<Res> resTypeTag) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.restate.client.Client
call, idempotentInvocationHandle, invocationHandle, send, send, sendAsync, submit, submit, submitAsync, submitAsync, workflowHandle
-
Constructor Details
-
BaseClient
protected BaseClient(URI baseUri, @Nullable SerdeFactory serdeFactory, @Nullable RequestOptions baseOptions)
-
-
Method Details
-
callAsync
-
sendAsync
public <Req,Res> CompletableFuture<SendResponse<Res>> sendAsync(Request<Req, Res> request, @Nullable Duration delay) -
awakeableHandle
Description copied from interface:Client
Create a newClient.AwakeableHandle
for the provided identifier. You can use it toClient.AwakeableHandle.resolve(TypeTag, Object)
orClient.AwakeableHandle.reject(String)
an Awakeable from the ingress.- Specified by:
awakeableHandle
in interfaceClient
-
invocationHandle
public <Res> Client.InvocationHandle<Res> invocationHandle(String invocationId, TypeTag<Res> resTypeTag) - Specified by:
invocationHandle
in interfaceClient
-
idempotentInvocationHandle
public <Res> Client.IdempotentInvocationHandle<Res> idempotentInvocationHandle(Target target, String idempotencyKey, TypeTag<Res> resTypeTag) - Specified by:
idempotentInvocationHandle
in interfaceClient
-
workflowHandle
public <Res> Client.WorkflowHandle<Res> workflowHandle(String workflowName, String workflowId, TypeTag<Res> resTypeTag) - Specified by:
workflowHandle
in interfaceClient
-
doPostRequest
protected abstract <Res> CompletableFuture<Res> doPostRequest(URI target, Stream<Map.Entry<String, String>> headers, Slice payload, BaseClient.ResponseMapper<Res> responseMapper) -
doGetRequest
protected abstract <Res> CompletableFuture<Res> doGetRequest(URI target, Stream<Map.Entry<String, String>> headers, BaseClient.ResponseMapper<Res> responseMapper)
-