Module raft_consensus::state_machine[][src]

A StateMachine is a single instance of a distributed application. It is the raft libraries responsibility to take commands from the Client and apply them to each StateMachine instance in a globally consistent order.

The StateMachine is interface is intentionally generic so that any distributed application needing consistent state can be built on it. For instance, a distributed hash table application could implement StateMachine, with commands corresponding to insert, and remove. The raft library would guarantee that the same order of insert and remove commands would be seen by all consensus modules.

Re-exports

pub use state_machine::channel::ChannelStateMachine;
pub use state_machine::null::NullStateMachine;

Modules

channel
null

Traits

StateMachine

This trait is meant to be implemented such that the commands issued to it via apply() will be reflected in your consuming application. Commands sent via apply() have been committed in the cluser. Unlike store, your application should consume data produced by this and accept it as truth.