toService

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

Create a builder for invoking a Restate service from within a handler.

Example usage:

@Handler
suspend fun myHandler(): String {
val result = toService<Greeter>()
.request { greet("Alice") }
.call()
.await()
return result
}

Return

a builder for creating typed requests

Parameters

SVC

the service class annotated with @Service