service

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

Create a proxy client for a Restate service.

This creates a proxy that allows calling service methods directly. The proxy intercepts method calls, converts them to Restate requests, and awaits the result.

Example usage:

@Handler
suspend fun myHandler(): String {
val greeter = service<Greeter>()
val response = greeter.greet("Alice")
return "Got: $response"
}

Return

a proxy client to invoke the service

Parameters

SVC

the service class annotated with @Service