共用方式為


KeyValueStoreReplica.ChangeRoleAsync(ReplicaRole, CancellationToken) Method

Definition

Changes the replica role of the replica and its replicator.

public System.Threading.Tasks.Task<string> ChangeRoleAsync (System.Fabric.ReplicaRole newRole, System.Threading.CancellationToken cancellationToken);
abstract member ChangeRoleAsync : System.Fabric.ReplicaRole * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
override this.ChangeRoleAsync : System.Fabric.ReplicaRole * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function ChangeRoleAsync (newRole As ReplicaRole, cancellationToken As CancellationToken) As Task(Of String)

Parameters

newRole
ReplicaRole

The target replica role.

cancellationToken
CancellationToken

Currently unused. Reserved for future use.

Returns

A task whose result is the address of this replica.

Implements

Remarks

This method does not need to be called explicitly if the application replica derives from KeyValueStoreReplica, which is the recommended pattern. In this case, the application replica should override OnChangeRoleAsync(ReplicaRole, CancellationToken) instead.

Applies to