pub struct LoggedEpochChange { /* private fields */ }Expand description
A sequence of epochs whose current position survives a restart.
Implementations§
Source§impl LoggedEpochChange
impl LoggedEpochChange
Sourcepub fn new(
me: NodeId,
peers: impl IntoIterator<Item = NodeId>,
timing: Timing,
) -> Self
pub fn new( me: NodeId, peers: impl IntoIterator<Item = NodeId>, timing: Timing, ) -> Self
Epoch-change among peers, over a leader detector with the given heartbeat and timeout and
stubborn children retransmitting every retransmit.
Sourcepub fn last_timestamp(&self) -> u64
pub fn last_timestamp(&self) -> u64
startts — the epoch this process has entered, as its durable record has it.
Sourcepub fn last_leader(&self) -> NodeId
pub fn last_leader(&self) -> NodeId
start — who leads the epoch this process has entered.
Trait Implementations§
Source§impl Debug for LoggedEpochChange
impl Debug for LoggedEpochChange
Source§impl Protocol for LoggedEpochChange
impl Protocol for LoggedEpochChange
Source§type Entry = Infallible
type Entry = Infallible
Nothing accumulates: the epoch entered is one value, rewritten.
Source§fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
upon event ⟨ lec, Init ⟩ — the state is set in new; this starts the detector.
Source§fn on_recovery(&mut self, cx: &mut ProtoCx<'_, Self>)
fn on_recovery(&mut self, cx: &mut ProtoCx<'_, Self>)
upon event ⟨ lec, Recovery ⟩ do retrieve(startts, start).
No StartEpoch is raised. The epoch is not new — this process entered it before it went
down, and told the layer above so at the time. Re-raising it would announce as fresh an
epoch whose consensus instance already exists, which is the layer above’s business to
reconstruct from its own record and not this layer’s to invent.
Source§type Cmd = Infallible
type Cmd = Infallible
Source§type Scope = Infallible
type Scope = Infallible
Source§type Meta = Started
type Meta = Started
Source§fn on_cmd(&mut self, cmd: Cmd, _: &mut ProtoCx<'_, Self>)
fn on_cmd(&mut self, cmd: Cmd, _: &mut ProtoCx<'_, Self>)
Source§fn on_msg(&mut self, from: NodeId, msg: Wire, cx: &mut ProtoCx<'_, Self>)
fn on_msg(&mut self, from: NodeId, msg: Wire, cx: &mut ProtoCx<'_, Self>)
from.