Condividi tramite


ServiceRuntime.RegisterServiceAsync Method

Definition

Overloads

RegisterServiceAsync(String, Func<StatefulServiceContext,StatefulServiceBase>, TimeSpan, CancellationToken)

Registers a reliable stateful service with Service Fabric runtime.

RegisterServiceAsync(String, Func<StatelessServiceContext,StatelessService>, TimeSpan, CancellationToken)

Registers a reliable stateless service with Service Fabric runtime.

RegisterServiceAsync(String, Func<StatefulServiceContext,StatefulServiceBase>, TimeSpan, CancellationToken)

Registers a reliable stateful service with Service Fabric runtime.

public static System.Threading.Tasks.Task RegisterServiceAsync (string serviceTypeName, Func<System.Fabric.StatefulServiceContext,Microsoft.ServiceFabric.Services.Runtime.StatefulServiceBase> serviceFactory, TimeSpan timeout = default, System.Threading.CancellationToken cancellationToken = default);
static member RegisterServiceAsync : string * Func<System.Fabric.StatefulServiceContext, Microsoft.ServiceFabric.Services.Runtime.StatefulServiceBase> * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Shared Function RegisterServiceAsync (serviceTypeName As String, serviceFactory As Func(Of StatefulServiceContext, StatefulServiceBase), Optional timeout As TimeSpan = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

serviceTypeName
String

The service type name as provied in service manifest.

serviceFactory
Func<StatefulServiceContext,StatefulServiceBase>

A factory method to create stateful service objects.

timeout
TimeSpan

The timeout for the register operation.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

A task that represents the asynchronous register operation.

Applies to

RegisterServiceAsync(String, Func<StatelessServiceContext,StatelessService>, TimeSpan, CancellationToken)

Registers a reliable stateless service with Service Fabric runtime.

public static System.Threading.Tasks.Task RegisterServiceAsync (string serviceTypeName, Func<System.Fabric.StatelessServiceContext,Microsoft.ServiceFabric.Services.Runtime.StatelessService> serviceFactory, TimeSpan timeout = default, System.Threading.CancellationToken cancellationToken = default);
static member RegisterServiceAsync : string * Func<System.Fabric.StatelessServiceContext, Microsoft.ServiceFabric.Services.Runtime.StatelessService> * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Shared Function RegisterServiceAsync (serviceTypeName As String, serviceFactory As Func(Of StatelessServiceContext, StatelessService), Optional timeout As TimeSpan = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

serviceTypeName
String

The service type name as provied in service manifest.

serviceFactory
Func<StatelessServiceContext,StatelessService>

A factory method to create stateless service objects.

timeout
TimeSpan

The timeout for the register operation.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

A task that represents the asynchronous register operation.

Applies to