Share via


ActorService Class

Definition

Represents the base class for Microsoft Service Fabric based reliable actors service.

public class ActorService : Microsoft.ServiceFabric.Services.Runtime.StatefulServiceBase, Microsoft.ServiceFabric.Actors.IActorService, Microsoft.ServiceFabric.Services.Remoting.IService
type ActorService = class
    inherit StatefulServiceBase
    interface IActorService
    interface IService
Public Class ActorService
Inherits StatefulServiceBase
Implements IActorService, IService
Inheritance
Implements

Remarks

Derive from this class to implement your own custom actor service if you want to override any service level behavior for your actors.

Constructors

ActorService(StatefulServiceContext, ActorTypeInformation, Func<ActorService, ActorId,ActorBase>, Func<ActorBase,IActorStateProvider,IActorStateManager>, IActorStateProvider, ActorServiceSettings)

Initializes a new instance of the ActorService class.

Properties

ActorTypeInformation

Gets the ActorTypeInformation for actor service.

Context

Gets the service context that this stateful service is operating under. It provides information like replica ID, partition ID, service name etc.

(Inherited from StatefulServiceBase)
Partition

Gets the service partition to which current service replica belongs.

(Inherited from StatefulServiceBase)
ServiceContext

Gets the Stateful service context.

(Inherited from StatefulServiceBase)
Settings

Gets the settings for the actor service.

StateProvider

Gets a IActorStateProvider that represents the state provider for the actor service.

Methods

AddMigrationListener(IList<ServiceReplicaListener>)

Adds migration specific listeners.

BackupAsync(BackupDescription, TimeSpan, CancellationToken)

Performs a backup of all reliable state managed by this StatefulServiceBase.

(Inherited from StatefulServiceBase)
BackupAsync(BackupDescription)

Performs a backup of all reliable state managed by this StatefulServiceBase.

(Inherited from StatefulServiceBase)
CreateServiceReplicaListeners()

Overrides CreateServiceReplicaListeners().

GetAddresses()

Gets the list of all the addresses for this service replica as (ListenerName, Endpoint) key-value pair.

(Inherited from StatefulServiceBase)
OnAbort()

Overrides OnAbort().

OnChangeRoleAsync(ReplicaRole, CancellationToken)

Overrides OnChangeRoleAsync(ReplicaRole, CancellationToken).

OnCloseAsync(CancellationToken)

Overrides OnCloseAsync(CancellationToken).

OnDataLossAsync(RestoreContext, CancellationToken)

This method is called during suspected data loss. You can override this method to restore the service in case of data loss.

(Inherited from StatefulServiceBase)
OnOpenAsync(ReplicaOpenMode, CancellationToken)

This method is called when the replica is being opened and it is the final step of opening the service. Override this method to be notified that Open has completed for this replica's internal components.

For information about Reliable Services life cycle please see https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-services-lifecycle

(Inherited from StatefulServiceBase)
OnRestoreCompletedAsync(CancellationToken)

This method is called when replica's state has been restored successfully via the Backup Restore service. This is only supported when the reliable state provider replica object passed in the constructor is derived from IStateProviderReplica2.

(Inherited from StatefulServiceBase)
RunAsync(CancellationToken)

Overrides RunAsync(CancellationToken).

Explicit Interface Implementations

IActorService.DeleteActorAsync(ActorId, CancellationToken)

Deletes an Actor from the Actor service.

IActorService.GetActorsAsync(ContinuationToken, CancellationToken)

Gets the list of Actors by querying the actor service.

IActorService.GetRemindersAsync(ActorId, ContinuationToken, CancellationToken)

Gets the list of reminders.

Applies to