toVirtualObject
Create a builder for invoking a Restate virtual object from within a handler.
Example usage:
@Handler
suspend fun myHandler(): Long {
val result = toVirtualObject<Counter>("my-counter")
.request { add(1) }
.call()
.await()
return result
}Content copied to clipboard
Return
a builder for creating typed requests
Parameters
SVC
the virtual object class annotated with @VirtualObject
key
the key identifying the specific virtual object instance