StatefulServiceBase.RunAsync(CancellationToken) Method

Definition

This method is implemented as a processing loop and will only be called when the replica is primary with write status. Override this method with the application logic.

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

protected virtual System.Threading.Tasks.Task RunAsync (System.Threading.CancellationToken cancellationToken);
abstract member RunAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.RunAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected Overridable Function RunAsync (cancellationToken As CancellationToken) As Task

Parameters

cancellationToken
CancellationToken

Cancellation token to monitor for cancellation requests.

Returns

A Task that represents outstanding operation.

Remarks

Please ensure you follow these guidelines when overriding RunAsync(CancellationToken):

Failing to conform to these guidelines can cause fail-over, reconfiguration or upgrade of your service to get stuck and can impact availability of your service.

Applies to