Class ObjectContext
- Namespace
- Restate.Sdk
- Assembly
- Restate.Sdk.dll
Context for exclusive handlers on virtual objects. Provides read-write state access. Only one exclusive handler runs at a time per key.
public abstract class ObjectContext : SharedObjectContext, IObjectContext, ISharedObjectContext, IContext
- Inheritance
-
ObjectContext
- Implements
- Derived
- Inherited Members
Methods
Clear(string)
Clears a single state key.
public abstract void Clear(string key)
Parameters
keystring
Clear(string, string?)
Clears a single state key, labelling the journal entry with
entryName. The name is observability only; the default
implementation drops it and clears through Clear(string).
public virtual void Clear(string key, string? entryName)
Parameters
ClearAll()
Clears all state keys for this virtual object instance.
public abstract void ClearAll()
ClearAll(string?)
Clears all state keys for this virtual object instance, labelling the journal entry
with entryName. The name is observability only; the default
implementation drops it and clears through ClearAll().
public virtual void ClearAll(string? entryName)
Parameters
entryNamestring
Set<T>(StateKey<T>, T)
Sets the value for the given state key.
public abstract void Set<T>(StateKey<T> key, T value)
Parameters
keyStateKey<T>valueT
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. The default implementation
drops the name and writes through Set<T>(StateKey<T>, T), so contexts
that predate entry names keep working.
public virtual void Set<T>(StateKey<T> key, T value, string? entryName)
Parameters
Type Parameters
T