Struct almost_raft::election::RaftElectionState [−][src]
pub struct RaftElectionState<T> { /* fields omitted */ }
Expand description
Current state of the Raft
Implementations
Initiate Raft election. This method doesn’t start the election.
Arguments
self_id
- Identifier of this nodeelection_timeout
- Time between the elections if no heartbeat is received. Will use a randomized value in range[election_timeout..election_timeout*2]
heartbeat_interval
- Interval between heartbeat messagemessage_timeout
- Timout before treating message sending as failurepeers
- other nodestx
- MPSC Sender to communicate with outside. Control messages will use this channelmax_node
- Maximum number of allowed node in the clustermin_node
- Minimum node required. Election will not start until number of node reachmin_node
Returns
Tuple - the initialized RaftElectionState
& a Sender of mpsc channel for incoming control messages