pub enum Input {
Write(WriteReq, WriteFuture),
Read(ReadReq, ReadFuture),
Tick(Instant),
Message(Message),
PersistRes(PersistRes),
ReadStateMachineRes(ReadStateMachineRes),
}
Expand description
Variants§
Write(WriteReq, WriteFuture)
A user request to enter a write in the replicated state machine.
The write payload is an opaque Vec<u8>
handed as-is to the state machine
for intrepretation. The provided future will be resolved when this write
completes.
Read(ReadReq, ReadFuture)
A user request to read from the replicated state machine.
The read payload is an opaque Vec<u8>
handed as-is to the state machine
for intrepretation. The provided future will be resolved when this read
completes.
Tick(Instant)
A communication to the Raft logic of the current time.
Correctness of this Raft implementation (including reads) is entirely independant from clocks. However, Raft very much relies on a periodic clock tick for availability. If ticks are delayed, unnecessary elections and leadership transfers will happen, which affects tail latencies.
TODO: How often should a tick event happen for a given Config
?
Message(Message)
An rpc resulting from a Output::Message
on another node.
PersistRes(PersistRes)
A communication that a Output::PersistReq
has completed.
ReadStateMachineRes(ReadStateMachineRes)
A communication that a Output::ReadStateMachineReq
has completed.