virtualObject

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

PREVIEW: Create a proxy client for 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 proxy client to invoke the virtual object

Parameters

key

the key identifying the specific virtual object instance

Type Parameters

SVC

the virtual object class annotated with @VirtualObject

See also


inline fun <SVC : Any> Client.virtualObject(key: String): SVC

Create a proxy client for a Restate virtual object.

Example usage:

val counter = client.virtualObject<Counter>("my-key")
val value = counter.increment()

Return

a proxy client to invoke the virtual object

Parameters

key

the key identifying the specific virtual object instance

Type Parameters

SVC

the virtual object class annotated with @VirtualObject