Class RaftCluster
Represents default implementation of Raft-based cluster.
Inherited Members
Namespace: DotNext.Net.Cluster.Consensus.Raft
Assembly: DotNext.Net.Cluster.dll
Syntax
public class RaftCluster : RaftCluster<RaftClusterMember>, IDisposable, IRaftCluster, IReplicationCluster<IRaftLogEntry>, IReplicationCluster, ICluster, IRaftStateMachine, ILocalMember
Constructors
| Improve this Doc View SourceRaftCluster(RaftCluster.NodeConfiguration)
Initializes a new default implementation of Raft-based cluster.
Declaration
public RaftCluster(RaftCluster.NodeConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
RaftCluster.NodeConfiguration | configuration | The configuration of the cluster. |
Methods
| Improve this Doc View SourceCreateClient(IPEndPoint)
Initializes a new client for communication with cluster member.
Declaration
protected RaftClusterMember CreateClient(IPEndPoint address)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | address | The address of the cluster member. |
Returns
Type | Description |
---|---|
RaftClusterMember | A new client for communication with cluster member. |
Remarks
This method is needed if you want to implement dynamic addition of the new cluster members.
Dispose(Boolean)
Releases managed and unmanaged resources associated with this object.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | true if called from Dispose(); false if called from finalizer Finalize(). |
Overrides
StartAsync(CancellationToken)
Starts serving local member.
Declaration
public override Task StartAsync(CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token | The token that can be used to cancel initialization process. |
Returns
Type | Description |
---|---|
Task | The task representing asynchronous execution of the method. |
Overrides
StopAsync(CancellationToken)
Stops serving local member.
Declaration
public override Task StopAsync(CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token | The token that can be used to cancel shutdown process. |
Returns
Type | Description |
---|---|
Task | The task representing asynchronous execution of the method. |