ActorStateProvider 接口

定义

Represents the interface that an actor state provider needs to implement for actor runtime to communicate with it.

public interface ActorStateProvider extends StateProviderReplica

继承成员

方法

actorActivatedAsync(ActorId actorId, CancellationToken cancellationToken)

This method is invoked as part of the activation process of the actor with the specified Id.

containsStateAsync(ActorId actorId, String stateName, CancellationToken cancellationToken)

Checks whether actor state provider contains an actor state with specified state name.

deleteReminderAsync(ActorId actorId, String reminderName, CancellationToken cancellationToken)

Deletes the specified actor reminder if it exists.

deleteRemindersAsync(Map<ActorId, Collection<String>> reminderNames, CancellationToken cancellationToken)

Deletes the specified set of reminders

enumerateStateNamesAsync(ActorId actorId, CancellationToken cancellationToken)

Creates an enumerable of all the state names associated with specified actor.

Remarks:The enumerator returned from actor state provider is safe to use concurrently with reads and writes to the state provider. It represents a snapshot consistent view of the state provider.

getActorsAsync(int numItemsToReturn, ContinuationToken continuationToken, CancellationToken cancellationToken)

Gets ActorIds from the State Provider.

Remarks: The

initialize(ActorTypeInformation actorTypeInformation)

Initializes the actor state provider with type information of the actor type associated with it.

loadRemindersAsync(CancellationToken cancellationToken)

Loads all the reminders contained in the actor state provider.

loadStateAsync(ActorId actorId, String stateName, CancellationToken cancellationToken)

Loads the actor state associated with the specified state name.

reminderCallbackCompletedAsync(ActorId actorId, ActorReminder reminder, CancellationToken cancellationToken)

Invoked when a reminder fires and finishes executing its callback receiveReminderAsync(String reminderName, byte[] context, Duration timeSpan, Duration period) successfully

removeActorAsync(ActorId actorId, CancellationToken cancellationToken)

Removes all the existing states and reminders associated with specified actor atomically.

saveReminderAsync(ActorId actorId, ActorReminder reminder, CancellationToken cancellationToken)

Saves the specified actor reminder. If an actor reminder with given name does not exist, it adds the actor reminder otherwise existing actor reminder with same name is updated.

saveStateAsync(ActorId actorId, List<ActorStateChange> stateChanges, CancellationToken cancellationToken)

Saves the specified set of actor state changes atomically.

Remarks: The collection of state changes should contain only one item for a given state name. The save operation will fail on trying to add an actor state which already exists or update/remove an actor state which does not exist.

适用于