다음을 통해 공유


IActorStateProvider.LoadStateAsync<T> Method

Definition

Loads the actor state associated with the specified state name for the specified actor ID.

public System.Threading.Tasks.Task<T> LoadStateAsync<T> (Microsoft.ServiceFabric.Actors.ActorId actorId, string stateName, System.Threading.CancellationToken cancellationToken = default);
abstract member LoadStateAsync : Microsoft.ServiceFabric.Actors.ActorId * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
Public Function LoadStateAsync(Of T) (actorId As ActorId, stateName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of T)

Type Parameters

T

Type of value of actor state associated with given state name.

Parameters

actorId
ActorId

ID of the actor for which to load the state.

stateName
String

Name of the actor state to load.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

Task<T>

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

Exceptions

Actor state associated with specified state name does not exist.

The operation was canceled.

Applies to