Expand description
§Raft
This is a crate containing a Raft consensus protocol implementation and encoding/decoding helpers. This is a logic-only crate without any networking part.
To use Raft in it’s full strength using this crate, one should do the following:
-
determine and implement(or take ready ones) state machine and persistent log implementations
-
find or make a part responsible for passing peer and client messages over the wire and pass all these messages from to one of
...Consensus
structures -
define a ConsensusHandler with callbacks doing the job for passing messages generated by consensus to other nodes
Re-exports§
pub use consensus::Consensus;
pub use handler::ConsensusHandler;
pub use persistent_log::Log;
pub use state_machine::StateMachine;
Modules§
- consensus
- Implementation of Raft consensus API
- error
- Error type with all possible errors
- handler
- Handlers for consensus callbacks
- message
- Messages that are passed during consensus work
- persistent_
log - The persistent storage of Raft state.
- shared
- Handle consensus from many threads
- state
- Provides consensus state type
- state_
machine - A
StateMachine
is a single instance of a distributed application. It is theraft
libraries responsibility to take commands from theClient
and apply them to eachStateMachine
instance in a globally consistent order.