toVirtualObject

@ApiStatus.Experimental
inline fun <SVC : Any> ScopedClient.toVirtualObject(key: String): KClientRequestBuilder<SVC>

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

NOTE: To use scopes with virtual objects you must enable the additional experimental feature in restate-server, via RESTATE_EXPERIMENTAL_ENABLE_SCOPED_VIRTUAL_OBJECTS=true.

Return

a builder for creating typed requests

Parameters

key

the key identifying the specific virtual object instance

Type Parameters

SVC

the virtual object class annotated with @VirtualObject

See also


Create a builder for invoking a Restate virtual object.

Example usage:

val response = client.toVirtualObject<Counter>("my-counter")
.request { add(1) }
.call()

Return

a builder for creating typed requests

Parameters

key

the key identifying the specific virtual object instance

Type Parameters

SVC

the virtual object class annotated with @VirtualObject