pub struct UniformReliableBroadcast<P: Clone, L: VolatileLink<Data<P>> = PerfectLink<Data<P>>> { /* private fields */ }Expand description
Broadcast with uniform agreement, over best-effort broadcast and a failure detector.
Implementations§
Source§impl<P: Clone> UniformReliableBroadcast<P, PerfectLink<Data<P>>>
impl<P: Clone> UniformReliableBroadcast<P, PerfectLink<Data<P>>>
Sourcepub fn new(
me: NodeId,
members: impl IntoIterator<Item = NodeId>,
retransmit: Duration,
heartbeat: Duration,
detect_after: Duration,
) -> Self
pub fn new( me: NodeId, members: impl IntoIterator<Item = NodeId>, retransmit: Duration, heartbeat: Duration, detect_after: Duration, ) -> Self
Broadcast among members, which must include me.
heartbeat and detect_after configure the failure detector; detect_after must exceed
heartbeat plus the network’s delivery bound, or the detector will accuse correct
processes and uniform agreement can break.
Source§impl<P: Clone, L: VolatileLink<Data<P>>> UniformReliableBroadcast<P, L>
impl<P: Clone, L: VolatileLink<Data<P>>> UniformReliableBroadcast<P, L>
Sourcepub fn with_link(
me: NodeId,
members: impl IntoIterator<Item = NodeId>,
link: L,
heartbeat: Duration,
detect_after: Duration,
) -> Self
pub fn with_link( me: NodeId, members: impl IntoIterator<Item = NodeId>, link: L, heartbeat: Duration, detect_after: Duration, ) -> Self
Broadcast among members, over the link supplied.
Sourcepub fn correct(&self) -> impl Iterator<Item = NodeId> + '_
pub fn correct(&self) -> impl Iterator<Item = NodeId> + '_
The processes still believed correct, in a stable order.
Sourcepub fn delivered_count(&self) -> usize
pub fn delivered_count(&self) -> usize
How many distinct messages have been delivered upward.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Messages seen but not yet deliverable.
Sourcepub fn acknowledged_by(
&self,
id: BroadcastId,
) -> impl Iterator<Item = NodeId> + '_
pub fn acknowledged_by( &self, id: BroadcastId, ) -> impl Iterator<Item = NodeId> + '_
Which processes have acknowledged id, for tests that need to see the condition forming.
Trait Implementations§
Source§impl<P: Debug + Clone, L: Debug + VolatileLink<Data<P>>> Debug for UniformReliableBroadcast<P, L>
impl<P: Debug + Clone, L: Debug + VolatileLink<Data<P>>> Debug for UniformReliableBroadcast<P, L>
Source§impl<P: Clone, L> Protocol for UniformReliableBroadcast<P, L>where
L: VolatileLink<Data<P>>,
impl<P: Clone, L> Protocol for UniformReliableBroadcast<P, L>where
L: VolatileLink<Data<P>>,
Source§type Scope = <L as Protocol>::Scope
type Scope = <L as Protocol>::Scope
No scope conditions: this protocol’s guarantees do not lapse. Whatever the link’s guarantees are conditional on. This layer bridges an ending rather than absorbing it, but bridging is not the same as never having lapsed.
Source§type Meta = Infallible
type Meta = Infallible
Keeps nothing durably: a crash loses everything this protocol knows.
Source§fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
Failure detection begins here, as Module 2.6 has it. It used to need a Start command
because there was no init event to hang the detector’s first timer on.
Source§fn on_scope_event(&mut self, scope: L::Scope, cx: &mut ProtoCx<'_, Self>)
fn on_scope_event(&mut self, scope: L::Scope, cx: &mut ProtoCx<'_, Self>)
Hand the scope ending down to the children. The trait’s default would drop it.
Source§type Msg = Wire<<L as Protocol>::Msg>
type Msg = Wire<<L as Protocol>::Msg>
Source§type Entry = Infallible
type Entry = Infallible
Source§fn on_cmd(&mut self, cmd: Cmd<P>, cx: &mut ProtoCx<'_, Self>)
fn on_cmd(&mut self, cmd: Cmd<P>, cx: &mut ProtoCx<'_, Self>)
Source§fn on_msg(
&mut self,
from: NodeId,
msg: Wire<L::Msg>,
cx: &mut ProtoCx<'_, Self>,
)
fn on_msg( &mut self, from: NodeId, msg: Wire<L::Msg>, cx: &mut ProtoCx<'_, Self>, )
from.