KClientRequest

@ApiStatus.Experimental
interface KClientRequest<Req, Res> : Request<Req, Res>

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

Example usage:

client.toService<CounterKt>()
.request { add(1) }
.options { idempotencyKey = "123" }
.call()

Parameters

Req

the request type

Res

the response type

Functions

Link copied to clipboard
abstract suspend fun call(): Response<Res>

Call the target handler and wait for the response.

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

Shorthand for callSuspend

Link copied to clipboard
Link copied to clipboard
abstract fun getIdempotencyKey(): String
Link copied to clipboard
abstract fun getRequest(): Req
Link copied to clipboard
abstract fun getRequestTypeTag(): TypeTag<Req>
Link copied to clipboard
abstract fun getResponseTypeTag(): TypeTag<Res>
Link copied to clipboard
abstract fun getTarget(): Target
Link copied to clipboard

Configure invocation options using a DSL.

Link copied to clipboard
abstract suspend fun send(delay: Duration? = null): SendResponse<Res>

Send the request without waiting for the response.

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
abstract fun toBuilder(): RequestBuilder<Req, Res>