Share via


IActorStateManager Interface

Definition

Represents an interface that exposes methods to manage state of an Actor. This interface is implemented by StateManager.

public interface IActorStateManager
type IActorStateManager = interface
Public Interface IActorStateManager

Methods

AddOrUpdateStateAsync<T>(String, T, Func<String,T,T>, CancellationToken)

Adds an actor state with given state name, if it does not already exist or updates the state with specified state name, if it exists.

AddStateAsync<T>(String, T, CancellationToken)

Adds an actor state with given state name.

ClearCacheAsync(CancellationToken)

Clears all the cached actor states and any operation(s) performed on IActorStateManager since last state save operation.

ContainsStateAsync(String, CancellationToken)

Checks if an actor state with specified name exists.

GetOrAddStateAsync<T>(String, T, CancellationToken)

Gets an actor state with the given state name if it exists. If it does not exist, creates and new state with the specified name and value.

GetStateAsync<T>(String, CancellationToken)

Gets an actor state with specified state name.

GetStateNamesAsync(CancellationToken)

Creates an enumerable of all actor state names for current actor.

RemoveStateAsync(String, CancellationToken)

Removes an actor state with specified state name.

SaveStateAsync(CancellationToken)

Saves all the cached state changes (add/update/remove) that were made since last call to SaveStateAsync(CancellationToken) by actor runtime or by user explicitly.

SetStateAsync<T>(String, T, CancellationToken)

Sets an actor state with given state name to specified value. If an actor state with specified name does not exist, it is added.

TryAddStateAsync<T>(String, T, CancellationToken)

Attempts to add an actor state with given state name and value. Returns false if an actor state with the same name already exists.

TryGetStateAsync<T>(String, CancellationToken)

Attempts to get an actor state with specified state name.

TryRemoveStateAsync(String, CancellationToken)

Attempts to remove an actor state with specified state name.

Applies to