다음을 통해 공유


IStatefulServiceReplica Interface

Definition

Defines behavior that governs the lifecycle of a replica, such as startup, initialization, role changes, and shutdown.

public interface IStatefulServiceReplica
type IStatefulServiceReplica = interface
Public Interface IStatefulServiceReplica
Derived

Remarks

Stateful service types must implement this interface. The Reliable Stateful service implements this interface and handles replica lifecycle internally.

The logic of a stateful service type includes behavior that is invoked on primary replicas and behavior that is invoked on secondary replicas.

If the service author wants to make use of the provided FabricReplicator, then the service must also implement IStateProvider to use the implementation of IStateReplicator that is provided by FabricReplicator.

Methods

Abort()

Ungracefully terminates the service replica.

ChangeRoleAsync(ReplicaRole, CancellationToken)

Changes the role of the service replica to one of the ReplicaRole.

CloseAsync(CancellationToken)

Closes the service replica gracefully when it is being shut down.

Initialize(StatefulServiceInitializationParameters)

Initializes a newly created service replica.

OpenAsync(ReplicaOpenMode, IStatefulServicePartition, CancellationToken)

Opens an initialized service replica so that additional actions can be taken.

Applies to