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 classprotected static interfaceNested classes/interfaces inherited from interface dev.restate.client.Client
Client.AwakeableHandle, Client.IdempotentInvocationHandle<Res>, Client.InvocationHandle<Res>, Client.WorkflowHandle<Res> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseClient(URI baseUri, @Nullable dev.restate.serde.SerdeFactory serdeFactory, @Nullable RequestOptions baseOptions) -
Method Summary
Modifier and TypeMethodDescriptionCreate a newClient.AwakeableHandlefor the provided identifier.<Req,Res> CompletableFuture<Response<Res>> callAsync(dev.restate.common.Request<Req, Res> request) 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, dev.restate.common.Slice payload, BaseClient.ResponseMapper<Res> responseMapper) <Res> Client.IdempotentInvocationHandle<Res>idempotentInvocationHandle(dev.restate.common.Target target, String idempotencyKey, dev.restate.serde.TypeTag<Res> resTypeTag) <Res> Client.InvocationHandle<Res>invocationHandle(String invocationId, dev.restate.serde.TypeTag<Res> resTypeTag) <Req,Res> CompletableFuture<SendResponse<Res>> <Res> Client.WorkflowHandle<Res>workflowHandle(String workflowName, String workflowId, dev.restate.serde.TypeTag<Res> resTypeTag) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 dev.restate.serde.SerdeFactory serdeFactory, @Nullable RequestOptions baseOptions)
-
-
Method Details
-
callAsync
public <Req,Res> CompletableFuture<Response<Res>> callAsync(dev.restate.common.Request<Req, Res> request) -
sendAsync
public <Req,Res> CompletableFuture<SendResponse<Res>> sendAsync(dev.restate.common.Request<Req, Res> request, @Nullable Duration delay) -
awakeableHandle
Description copied from interface:ClientCreate a newClient.AwakeableHandlefor the provided identifier. You can use it toClient.AwakeableHandle.resolve(TypeTag, Object)orClient.AwakeableHandle.reject(String)an Awakeable from the ingress.- Specified by:
awakeableHandlein interfaceClient
-
invocationHandle
public <Res> Client.InvocationHandle<Res> invocationHandle(String invocationId, dev.restate.serde.TypeTag<Res> resTypeTag) - Specified by:
invocationHandlein interfaceClient
-
idempotentInvocationHandle
public <Res> Client.IdempotentInvocationHandle<Res> idempotentInvocationHandle(dev.restate.common.Target target, String idempotencyKey, dev.restate.serde.TypeTag<Res> resTypeTag) - Specified by:
idempotentInvocationHandlein interfaceClient
-
workflowHandle
public <Res> Client.WorkflowHandle<Res> workflowHandle(String workflowName, String workflowId, dev.restate.serde.TypeTag<Res> resTypeTag) - Specified by:
workflowHandlein interfaceClient
-
doPostRequest
protected abstract <Res> CompletableFuture<Res> doPostRequest(URI target, Stream<Map.Entry<String, String>> headers, dev.restate.common.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)
-