pub struct EventuallyPerfectFailureDetector { /* private fields */ }Expand description
Detects crashes by heartbeat timeout, and changes its mind.
Implementations§
Source§impl EventuallyPerfectFailureDetector
impl EventuallyPerfectFailureDetector
Sourcepub fn new(
me: NodeId,
peers: impl IntoIterator<Item = NodeId>,
config: Config,
) -> Self
pub fn new( me: NodeId, peers: impl IntoIterator<Item = NodeId>, config: Config, ) -> Self
Detect among peers, adapting as config says.
Sourcepub fn suspected(&self) -> impl Iterator<Item = NodeId> + '_
pub fn suspected(&self) -> impl Iterator<Item = NodeId> + '_
The processes currently suspected. May shrink.
Sourcepub fn correct(&self) -> impl Iterator<Item = NodeId> + '_
pub fn correct(&self) -> impl Iterator<Item = NodeId> + '_
The processes not currently suspected, this one included.
Trait Implementations§
Source§impl Protocol for EventuallyPerfectFailureDetector
impl Protocol for EventuallyPerfectFailureDetector
Source§type Scope = Infallible
type Scope = Infallible
No scope conditions of its own: ◇P2’s conditions are on the network, not on a scope this
protocol is told about.
Source§type Meta = Infallible
type Meta = Infallible
Keeps nothing durably. A restarted detector suspects nobody and learns again.
Source§fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
⟨ ◇P, Init ⟩ do alive := Π; suspected := ∅; delay := Δ; starttimer(delay).
Source§fn on_msg(
&mut self,
from: NodeId,
Heartbeat: Heartbeat,
cx: &mut ProtoCx<'_, Self>,
)
fn on_msg( &mut self, from: NodeId, Heartbeat: Heartbeat, cx: &mut ProtoCx<'_, Self>, )
A heartbeat is alive := alive ∪ {p}. Note what is not here: no check against
suspected. Hearing from a suspected process is exactly the case Restore exists for, and
the round’s own pass is where it is noticed.
Source§type Cmd = Infallible
type Cmd = Infallible
Requests from the layer above.
Source§type Entry = Infallible
type Entry = Infallible
The durable entries this protocol appends: what accumulates.
Source§fn on_cmd(&mut self, cmd: Cmd, _cx: &mut ProtoCx<'_, Self>)
fn on_cmd(&mut self, cmd: Cmd, _cx: &mut ProtoCx<'_, Self>)
Handle a request from the layer above.
Source§fn on_timer(&mut self, id: TimerId, cx: &mut ProtoCx<'_, Self>)
fn on_timer(&mut self, id: TimerId, cx: &mut ProtoCx<'_, Self>)
Handle a timer that fired somewhere in this protocol or in what it composes. Read more
§fn on_recovery(
&mut self,
_cx: &mut Cx<'_, Self::Msg, Self::Ind, Self::Note, Self::Meta, Self::Entry>,
)
fn on_recovery( &mut self, _cx: &mut Cx<'_, Self::Msg, Self::Ind, Self::Note, Self::Meta, Self::Entry>, )
Resume after a crash, reading what survived. Read more
§fn on_scope_event(
&mut self,
_scope: Self::Scope,
_cx: &mut Cx<'_, Self::Msg, Self::Ind, Self::Note, Self::Meta, Self::Entry>,
)
fn on_scope_event( &mut self, _scope: Self::Scope, _cx: &mut Cx<'_, Self::Msg, Self::Ind, Self::Note, Self::Meta, Self::Entry>, )
Handle a boundary of a scope this protocol’s guarantees depend on — its end, or the
beginning of the one that succeeds it. Read more
Auto Trait Implementations§
impl Freeze for EventuallyPerfectFailureDetector
impl RefUnwindSafe for EventuallyPerfectFailureDetector
impl Send for EventuallyPerfectFailureDetector
impl Sync for EventuallyPerfectFailureDetector
impl Unpin for EventuallyPerfectFailureDetector
impl UnsafeUnpin for EventuallyPerfectFailureDetector
impl UnwindSafe for EventuallyPerfectFailureDetector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more