pub struct EventualLeaderDetector<D: VolatileDetector = EventuallyPerfectFailureDetector> { /* private fields */ }Expand description
Trust the highest-ranked process not currently suspected.
Implementations§
Source§impl EventualLeaderDetector<EventuallyPerfectFailureDetector>
impl EventualLeaderDetector<EventuallyPerfectFailureDetector>
Sourcepub fn new(
me: NodeId,
peers: impl IntoIterator<Item = NodeId>,
heartbeat: Duration,
detect_after: Duration,
) -> Self
pub fn new( me: NodeId, peers: impl IntoIterator<Item = NodeId>, heartbeat: Duration, detect_after: Duration, ) -> Self
Ω among peers, over the eventually perfect detector Algorithm 2.8 names.
detect_after is the silence a peer is allowed to begin with: ◇P adapts it, and will
suspect correct processes while it is below what the network actually needs — which is a
fault this module faithfully passes on, and which the suites above deliberately provoke.
Source§impl<D: VolatileDetector> EventualLeaderDetector<D>
impl<D: VolatileDetector> EventualLeaderDetector<D>
Sourcepub fn with_detector(
me: NodeId,
peers: impl IntoIterator<Item = NodeId>,
build: impl FnOnce(NodeId, BTreeSet<NodeId>) -> D,
) -> Self
pub fn with_detector( me: NodeId, peers: impl IntoIterator<Item = NodeId>, build: impl FnOnce(NodeId, BTreeSet<NodeId>) -> D, ) -> Self
Ω among peers, over whatever detector build supplies.
Source§impl EventualLeaderDetector<PerfectFailureDetector>
impl EventualLeaderDetector<PerfectFailureDetector>
Sourcepub fn over_perfect_detection(
me: NodeId,
peers: impl IntoIterator<Item = NodeId>,
heartbeat: Duration,
detect_after: Duration,
) -> Self
pub fn over_perfect_detection( me: NodeId, peers: impl IntoIterator<Item = NodeId>, heartbeat: Duration, detect_after: Duration, ) -> Self
Ω over a perfect failure detector beating every heartbeat and accusing after
detect_after of silence.
Trait Implementations§
Source§impl<D: Debug + VolatileDetector> Debug for EventualLeaderDetector<D>
impl<D: Debug + VolatileDetector> Debug for EventualLeaderDetector<D>
Source§impl<D: VolatileDetector> Protocol for EventualLeaderDetector<D>
impl<D: VolatileDetector> Protocol for EventualLeaderDetector<D>
Source§type Scope = Infallible
type Scope = Infallible
No scope conditions of its own.
Source§type Meta = Infallible
type Meta = Infallible
Keeps nothing durably: a restarted process suspects nobody and trusts afresh.
Source§fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
upon event ⟨ Ω, Init ⟩ — and immediately a first Trust, since with nobody suspected
maxrank(Π) is already defined and the standing condition already holds.
Source§type Cmd = Infallible
type Cmd = Infallible
Source§type Entry = Infallible
type Entry = Infallible
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: D::Msg, cx: &mut ProtoCx<'_, Self>)
fn on_msg(&mut self, from: NodeId, msg: D::Msg, cx: &mut ProtoCx<'_, Self>)
from.