ActorStateManager Interface

Definition

Represents the interface that state manager for Actor implements.

public interface ActorStateManager

Methods

addOrUpdateStateAsync(String stateName, T addValue, BiFunction<String, T, T> updateValueFactory)

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

addOrUpdateStateAsync(String stateName, T addValue, BiFunction<String, T, T> updateValueFactory, CancellationToken cancellationToken)

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

addStateAsync(String stateName, T value)

Adds an actor state with given state name.

addStateAsync(String stateName, T value, CancellationToken cancellationToken)

Adds an actor state with given state name.

clearCacheAsync()

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

Remarks: All the operation(s) performed on ActorStateManager since last save operation are cleared on clearing the cache and will not be included in next save operation.

clearCacheAsync(CancellationToken cancellationToken)

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

Remarks: All the operation(s) performed on ActorStateManager since last save operation are cleared on clearing the cache and will not be included in next save operation.

containsStateAsync(String stateName)

Checks if an actor state with specified name exists.

containsStateAsync(String stateName, CancellationToken cancellationToken)

Checks if an actor state with specified name exists.

getOrAddStateAsync(String stateName, T value)

Gets an actor state with given state name, if it exists or adds the state with the state with specified state name, if it exists.

getOrAddStateAsync(String stateName, T value, CancellationToken cancellationToken)

Gets an actor state with given state name, if it exists or adds the state with the state with specified state name, if it exists.

getStateAsync(String stateName)

Gets an actor state with specified state name.

getStateAsync(String stateName, CancellationToken cancellationToken)

Gets an actor state with specified state name.

getStateNamesAsync()

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

getStateNamesAsync(CancellationToken cancellationToken)

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

removeStateAsync(String stateName)

Removes an actor state with given state name to specified value.

removeStateAsync(String stateName, CancellationToken cancellationToken)

Removes an actor state with given state name to specified value.

saveStateAsync()

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

saveStateAsync(CancellationToken cancellationToken)

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

setStateAsync(String stateName, T value)

Removes an actor state with specified state name. If an actor state with specified name does not exist, it is added.

setStateAsync(String stateName, T value, CancellationToken cancellationToken)

Removes an actor state with specified state name. If an actor state with specified name does not exist, it is added.

tryAddStateAsync(String stateName, T value)

Attempts to add an actor state with given state name.

tryAddStateAsync(String stateName, T value, CancellationToken cancellationToken)

Attempts to add an actor state with given state name.

tryGetStateAsync(String stateName)

Attempts to get an actor state with specified state name.

tryGetStateAsync(String stateName, CancellationToken cancellationToken)

Attempts to get an actor state with specified state name.

tryRemoveStateAsync(String stateName)

Attempts to remove an actor state with specified state name.

tryRemoveStateAsync(String stateName, CancellationToken cancellationToken)

Attempts to remove an actor state with specified state name.

Applies to