IActorStateManager.GetStateAsync<T>(String, CancellationToken) Method

Definition

Gets an actor state with specified state name.

public System.Threading.Tasks.Task<T> GetStateAsync<T> (string stateName, System.Threading.CancellationToken cancellationToken = null);
abstract member GetStateAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>

Type Parameters

T

Type of value associated with given state name.

Parameters

stateName
String

Name of the actor state to get.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

Task<T>

A task that represents the asynchronous get operation. The value of TResult parameter contains value of actor state with given state name.

Exceptions

An actor state with given state name does not exist.

The specified state name is null.

The operation was canceled.

Remarks

The type of state value T must be Data Contract serializable.

Applies to