Interface IStandbyModeSupport
Provides support of Standby state in addition to standard cluster member states defined in Raft (follower, candidate, leader).
Inherited Members
Namespace: DotNext.Net.Cluster.Consensus.Raft.Extensions
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IStandbyModeSupport : IRaftCluster, IReplicationCluster<IRaftLogEntry>, IReplicationCluster, ICluster, IPeerMesh<IClusterMember>, IPeerMesh<IRaftClusterMember>, IPeerMesh
Properties
| Edit this page View SourceStandby
Gets a value indicating that the local member cannot be elected as cluster leader.
Declaration
bool Standby { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceEnableStandbyModeAsync(CancellationToken)
Suspends any transition over Raft states.
Declaration
ValueTask<bool> EnableStandbyModeAsync(CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
ValueTask<bool> | true if any further state transitions are suspended successfully because the local member is in Follower state; false if operation fails because state transition is already suspended or the local member is not in Follower state. |
Remarks
This method completes successfully only if the local member is in Follower state.
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | This object has been disposed. |
RevertToNormalModeAsync(CancellationToken)
Turns this node into regular state when the node can be elected as leader.
Declaration
ValueTask<bool> RevertToNormalModeAsync(CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
ValueTask<bool> | true if state transition is resumed successfully; false if state transition was not suspended. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | This object has been disposed. |