KRequest

interface KRequest<Req, Res> : Request<Req, Res>

Kotlin-idiomatic request for invoking Restate services from within a handler.

Example usage:

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

Type Parameters

Req

the request type

Res

the response type

Properties

Link copied to clipboard
abstract override val headers: Map<String?, String?>??
Link copied to clipboard
abstract override val idempotencyKey: String?
Link copied to clipboard
@get:ApiStatus.Experimental
abstract override val limitKey: String?
Link copied to clipboard
abstract override val request: Req?
Link copied to clipboard
abstract override val requestTypeTag: TypeTag<Req?>?
Link copied to clipboard
abstract override val responseTypeTag: TypeTag<Res?>?
Link copied to clipboard
abstract override val target: Target?

Functions

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

Call the target handler and return a CallDurableFuture for the result.

Link copied to clipboard
suspend fun <Req, Res> Request<Req, Res>.call(context: Context): CallDurableFuture<Res>

Shorthand for Context.call

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 options(block: InvocationOptions.Builder.() -> Unit): KRequest<Req, Res>

Configure invocation options using a DSL.

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

Send the request without waiting for the response.

Link copied to clipboard
suspend fun <Req, Res> Request<Req, Res>.send(context: Context, delay: Duration? = null): InvocationHandle<Res>

Shorthand for Context.send

Link copied to clipboard
abstract fun toBuilder(): RequestBuilder<Req?, Res?>?