Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ServiceRuntime.RegisterServiceAsync Method

Definition

Namespace:
Microsoft.ServiceFabric.Services.Runtime
Assembly:
Microsoft.ServiceFabric.Services.dll
Package:
Microsoft.ServiceFabric.Services v6.1.1583

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
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


Feedback

Was this page helpful?