toService

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

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

Example usage:

client.scope("tenant-123").toService<MyService>()
.request { process(payload) }
.options { idempotencyKey = "req-1" }
.call()

Return

a builder for creating typed requests

Type Parameters

SVC

the service class annotated with @Service

See also


Create a builder for invoking a Restate service.

Example usage:

val response = client.toService<Greeter>()
.request { greet("Alice") }
.call()

Return

a builder for creating typed requests

Type Parameters

SVC

the service class annotated with @Service