Package-level declarations

Types

Link copied to clipboard
interface KClientRequest<Req, Res> : Request<Req, Res>

Kotlin-idiomatic request for invoking Restate services from an ingress client.

Link copied to clipboard

Builder for creating type-safe requests.

Link copied to clipboard
@ApiStatus.Experimental
class ScopedKotlinClient

PREVIEW: A client for making RPC calls within a specific scope.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun <T> Client.IdempotentInvocationHandle<T>.attachSuspend(options: RequestOptions = RequestOptions.DEFAULT): Response<T>
suspend fun <T> Client.InvocationHandle<T>.attachSuspend(options: RequestOptions = RequestOptions.DEFAULT): Response<T>

Suspend version of Client.InvocationHandle.attach.

suspend fun <T> Client.WorkflowHandle<T>.attachSuspend(options: RequestOptions = RequestOptions.DEFAULT): Response<T>

Suspend version of Client.WorkflowHandle.attach.

Link copied to clipboard
suspend fun <Req, Res> Request<Req, Res>.call(client: Client): Response<Res>

Shorthand for callSuspend

Link copied to clipboard
suspend fun <Req, Res> Client.callSuspend(request: Request<Req, Res>): Response<Res>

Call a service and wait for the response.

Link copied to clipboard
suspend fun <T> Client.IdempotentInvocationHandle<T>.getOutputSuspend(options: RequestOptions = RequestOptions.DEFAULT): Response<Output<T>>
suspend fun <T> Client.InvocationHandle<T>.getOutputSuspend(options: RequestOptions = RequestOptions.DEFAULT): Response<Output<T>>
suspend fun <T> Client.WorkflowHandle<T>.getOutputSuspend(options: RequestOptions = RequestOptions.DEFAULT): Response<Output<T>>
Link copied to clipboard

Create a new Client.IdempotentInvocationHandle for the provided target and idempotency key.

Link copied to clipboard

Create a new Client.InvocationHandle for the provided invocation identifier.

Link copied to clipboard
suspend fun Client.AwakeableHandle.rejectSuspend(reason: String, options: RequestOptions = RequestOptions.DEFAULT): Response<Void>

Complete with failure the Awakeable.

Link copied to clipboard

Request options builder function

Link copied to clipboard
inline suspend fun <T : Any> Client.AwakeableHandle.resolveSuspend(payload: T, options: RequestOptions = RequestOptions.DEFAULT): Response<Void>
suspend fun <T : Any> Client.AwakeableHandle.resolveSuspend(typeTag: TypeTag<T>, payload: T, options: RequestOptions = RequestOptions.DEFAULT): Response<Void>

Complete with success the Awakeable.

Link copied to clipboard
@ApiStatus.Experimental
fun Client.scope(scopeKey: String): ScopedKotlinClient

PREVIEW: Returns a ScopedKotlinClient that routes all outgoing calls within the given scope.

Link copied to clipboard
suspend fun <Req, Res> Request<Req, Res>.send(client: Client, delay: Duration? = null): SendResponse<Res>

Shorthand for sendSuspend

Link copied to clipboard
suspend fun <Req, Res> Client.sendSuspend(request: Request<Req, Res>, delay: Duration? = null): SendResponse<Res>

Send a request to a service without waiting for the response, optionally providing an execution delay to wait for.

Link copied to clipboard
inline fun <SVC : Any> Client.service(): SVC

Create a proxy client for a Restate service.

@ApiStatus.Experimental
inline fun <SVC : Any> ScopedClient.service(): SVC

PREVIEW: Create a proxy client for a Restate service within the given scope.

Link copied to clipboard
suspend fun <Req, Res> WorkflowRequest<Req, Res>.submit(client: Client, delay: Duration? = null): SendResponse<Res>

Shorthand for submitSuspend

Link copied to clipboard
suspend fun <Req, Res> Client.submitSuspend(request: WorkflowRequest<Req, Res>, delay: Duration? = null): SendResponse<Res>

Submit a workflow, optionally providing an execution delay to wait for.

Link copied to clipboard

Create a builder for invoking a Restate service.

@ApiStatus.Experimental
inline fun <SVC : Any> ScopedClient.toService(): KClientRequestBuilder<SVC>

PREVIEW: Create a builder for invoking a Restate service within the given scope.

Link copied to clipboard

Create a builder for invoking a Restate virtual object.

@ApiStatus.Experimental
inline fun <SVC : Any> ScopedClient.toVirtualObject(key: String): KClientRequestBuilder<SVC>

PREVIEW: Create a builder for invoking a Restate virtual object within the given scope.

Link copied to clipboard

Create a builder for invoking a Restate workflow.

@ApiStatus.Experimental
inline fun <SVC : Any> ScopedClient.toWorkflow(key: String): KClientRequestBuilder<SVC>

PREVIEW: Create a builder for invoking a Restate workflow within the given scope.

Link copied to clipboard
inline fun <SVC : Any> Client.virtualObject(key: String): SVC

Create a proxy client for a Restate virtual object.

@ApiStatus.Experimental
inline fun <SVC : Any> ScopedClient.virtualObject(key: String): SVC

PREVIEW: Create a proxy client for a Restate virtual object within the given scope.

Link copied to clipboard
inline fun <SVC : Any> Client.workflow(key: String): SVC

Create a proxy client for a Restate workflow.

@ApiStatus.Experimental
inline fun <SVC : Any> ScopedClient.workflow(key: String): SVC

PREVIEW: Create a proxy client for a Restate workflow within the given scope.

Link copied to clipboard
inline fun <Res> Client.workflowHandle(workflowName: String, workflowId: String): Client.WorkflowHandle<Res>

Create a new Client.WorkflowHandle for the provided workflow name and identifier.