Actor Class

Definition

Represents an actor that can have multiple reliable 'named' states associated with it.

public abstract class Actor : Microsoft.ServiceFabric.Actors.Runtime.ActorBase
type Actor = class
    inherit ActorBase
Public MustInherit Class Actor
Inherits ActorBase
Inheritance

Remarks

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 IActorStateProvider.

Constructors

Actor(ActorService, ActorId)

Initializes a new instance of the Actor class.

Properties

ActorService

Gets the stateful service replica that is hosting the actor.

(Inherited from ActorBase)
ApplicationName

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

(Inherited from ActorBase)
Id

Gets the identity of this actor with the actor service.

(Inherited from ActorBase)
ServiceUri

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

(Inherited from ActorBase)
StateManager

Gets the state manager for Actor which can be used to get/add/update/remove named states.

Methods

GetEvent<TEvent>()

Gets the event for the specified event interface.

(Inherited from ActorBase)
GetReminder(String)

Gets the actor reminder with specified reminder name.

(Inherited from ActorBase)
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.

(Inherited from ActorBase)
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.

(Inherited from ActorBase)
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.

(Inherited from ActorBase)
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.

(Inherited from ActorBase)
RegisterReminderAsync(String, Byte[], TimeSpan, TimeSpan)

Registers a reminder with the actor.

(Inherited from ActorBase)
RegisterTimer(Func<Object,Task>, Object, TimeSpan, TimeSpan)

Registers a Timer for the actor.

(Inherited from ActorBase)
SaveStateAsync()

Saves all the state changes (add/update/remove) that were made since last call to SaveStateAsync(), to the actor state provider associated with the actor.

UnregisterReminderAsync(IActorReminder)

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

(Inherited from ActorBase)
UnregisterTimer(IActorTimer)

Unregisters a Timer previously set on this actor.

(Inherited from ActorBase)

Applies to

See also