Table of Contents

Interface ISharedObjectContext

Namespace
Restate.Sdk
Assembly
Restate.Sdk.dll

Interface for shared handlers on virtual objects. Provides read-only state access and can run concurrently with other shared handlers for the same key.

public interface ISharedObjectContext : IContext
Inherited Members

Properties

Key

The key of the virtual object instance.

string Key { get; }

Property Value

string

Methods

Get<T>(StateKey<T>)

Gets the value for the given state key, or default if not set.

ValueTask<T?> Get<T>(StateKey<T> key)

Parameters

key StateKey<T>

Returns

ValueTask<T>

Type Parameters

T

Get<T>(StateKey<T>, string?)

Gets the value for the given state key, or default if not set, labelling the journal entry with entryName so it reads as that name in the Restate UI. The name is observability only: it does not change what is read, and omitting it records the same entry as Get<T>(StateKey<T>).

ValueTask<T?> Get<T>(StateKey<T> key, string? entryName)

Parameters

key StateKey<T>
entryName string

Returns

ValueTask<T>

Type Parameters

T

StateKeys()

Lists all state keys for this virtual object instance.

ValueTask<string[]> StateKeys()

Returns

ValueTask<string[]>

StateKeys(string?)

Lists all state keys for this virtual object instance, labelling the journal entry with entryName. The name is observability only.

ValueTask<string[]> StateKeys(string? entryName)

Parameters

entryName string

Returns

ValueTask<string[]>