Dela via


ActorRuntime.RegisterActorAsync Method

Definition

Overloads

RegisterActorAsync<TActor>(TimeSpan, CancellationToken)

Registers an actor type with Service Fabric runtime. This allows the runtime to create instances of this actor.

RegisterActorAsync<TActor>(Func<StatefulServiceContext,ActorTypeInformation,ActorService>, TimeSpan, CancellationToken)

Registers an actor service with Service Fabric runtime. This allows the runtime to create instances of the replicas for the actor service.

RegisterActorAsync<TActor>(TimeSpan, CancellationToken)

Registers an actor type with Service Fabric runtime. This allows the runtime to create instances of this actor.

public static System.Threading.Tasks.Task RegisterActorAsync<TActor> (TimeSpan timeout = default, System.Threading.CancellationToken cancellationToken = default) where TActor : Microsoft.ServiceFabric.Actors.Runtime.ActorBase;
static member RegisterActorAsync : TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task (requires 'Actor :> Microsoft.ServiceFabric.Actors.Runtime.ActorBase)
Public Shared Function RegisterActorAsync(Of TActor As ActorBase) (Optional timeout As TimeSpan = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

Type Parameters

TActor

The type implementing the actor.

Parameters

timeout
TimeSpan

A timeout period after which the registration operation will be canceled.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

returns a task that represents the asynchronous operation to register actor type with Service Fabric runtime.

Applies to

RegisterActorAsync<TActor>(Func<StatefulServiceContext,ActorTypeInformation,ActorService>, TimeSpan, CancellationToken)

Registers an actor service with Service Fabric runtime. This allows the runtime to create instances of the replicas for the actor service.

public static System.Threading.Tasks.Task RegisterActorAsync<TActor> (Func<System.Fabric.StatefulServiceContext,Microsoft.ServiceFabric.Actors.Runtime.ActorTypeInformation,Microsoft.ServiceFabric.Actors.Runtime.ActorService> actorServiceFactory, TimeSpan timeout = default, System.Threading.CancellationToken cancellationToken = default) where TActor : Microsoft.ServiceFabric.Actors.Runtime.ActorBase;
static member RegisterActorAsync : Func<System.Fabric.StatefulServiceContext, Microsoft.ServiceFabric.Actors.Runtime.ActorTypeInformation, Microsoft.ServiceFabric.Actors.Runtime.ActorService> * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task (requires 'Actor :> Microsoft.ServiceFabric.Actors.Runtime.ActorBase)
Public Shared Function RegisterActorAsync(Of TActor As ActorBase) (actorServiceFactory As Func(Of StatefulServiceContext, ActorTypeInformation, ActorService), Optional timeout As TimeSpan = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

Type Parameters

TActor

The Type implementing actor.

Parameters

actorServiceFactory
Func<StatefulServiceContext,ActorTypeInformation,ActorService>

The delegate that creates new actor service.

timeout
TimeSpan

A timeout period after which the registration operation will be canceled.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

A task that represents the asynchronous operation to register actor service with Service Fabric runtime.

Applies to