Table of Contents

Interface IObjectContext

Namespace
Restate.Sdk
Assembly
Restate.Sdk.dll

Interface for exclusive handlers on virtual objects. Provides read-write state access. Only one exclusive handler runs at a time per key.

public interface IObjectContext : ISharedObjectContext, IContext
Inherited Members

Methods

Clear(string)

Clears a single state key.

void Clear(string key)

Parameters

key string

Clear(string, string?)

Clears a single state key, labelling the journal entry with entryName. The name is observability only.

void Clear(string key, string? entryName)

Parameters

key string
entryName string

ClearAll()

Clears all state keys for this virtual object instance.

void ClearAll()

ClearAll(string?)

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

void ClearAll(string? entryName)

Parameters

entryName string

Set<T>(StateKey<T>, T)

Sets the value for the given state key.

void Set<T>(StateKey<T> key, T value)

Parameters

key StateKey<T>
value T

Type Parameters

T

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

Sets the value for the given state key, 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 written, and omitting it records the same entry as Set<T>(StateKey<T>, T).

void Set<T>(StateKey<T> key, T value, string? entryName)

Parameters

key StateKey<T>
value T
entryName string

Type Parameters

T