ActorBase Class

Definition

Represents the base class for actors.

public abstract class ActorBase
type ActorBase = class
Public MustInherit Class ActorBase
Inheritance
ActorBase
Derived

Remarks

The base type for actors, that provides the common functionality for actors that derive from Actor. The state is preserved across actor garbage collections and fail-overs. The storage and retrieval of the state is provided by the actor state provider. See IActorStateProvider for more information.

Properties

ActorService

Gets the stateful service replica that is hosting the actor.

ApplicationName

Gets the name of the application that contains the actor service that is hosting this actor.

Id

Gets the identity of this actor with the actor service.

ServiceUri

Gets the URI of the actor service that is hosting this actor.

Methods

GetEvent<TEvent>()

Gets the event for the specified event interface.

GetReminder(String)

Gets the actor reminder with specified reminder name.

OnActivateAsync()

Override this method to initialize the members, initialize state or register timers. This method is called right after the actor is activated and before any method call or reminders are dispatched on it.

OnDeactivateAsync()

Override this method to release any resources. This method is called when actor is deactivated (garbage collected by Actor Runtime). Actor operations like state changes should not be called from this method.

OnPostActorMethodAsync(ActorMethodContext)

Override this method for performing any actions after an actor method has finished execution. This method is invoked by actor runtime an actor method has finished execution.

OnPreActorMethodAsync(ActorMethodContext)

Override this method for performing any actions prior to an actor method is invoked. This method is invoked by actor runtime just before invoking an actor method.

RegisterReminderAsync(String, Byte[], TimeSpan, TimeSpan)

Registers a reminder with the actor.

RegisterTimer(Func<Object,Task>, Object, TimeSpan, TimeSpan)

Registers a Timer for the actor.

UnregisterReminderAsync(IActorReminder)

Unregisters a reminder previously registered using RegisterReminderAsync(String, Byte[], TimeSpan, TimeSpan).

UnregisterTimer(IActorTimer)

Unregisters a Timer previously set on this actor.

Applies to

See also