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 = default);
abstract member GetStateAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
Public Function GetStateAsync(Of T) (stateName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of 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