pub struct MajorityAckUniformReliableBroadcast<P: Clone, L: VolatileLink<Data<P>> = PerfectLink<Data<P>>> { /* private fields */ }Expand description
Broadcast with uniform agreement, resting on a correct majority and on nothing else.
Implementations§
Source§impl<P: Clone> MajorityAckUniformReliableBroadcast<P, PerfectLink<Data<P>>>
impl<P: Clone> MajorityAckUniformReliableBroadcast<P, PerfectLink<Data<P>>>
Sourcepub fn new(
me: NodeId,
members: impl IntoIterator<Item = NodeId>,
retransmit: Duration,
) -> Self
pub fn new( me: NodeId, members: impl IntoIterator<Item = NodeId>, retransmit: Duration, ) -> Self
Broadcast among members, which must include me.
The guarantees hold while more than half of members are correct. There is no timing
parameter, because there is no timeout: nothing here waits on a clock.
Source§impl<P: Clone, L: VolatileLink<Data<P>>> MajorityAckUniformReliableBroadcast<P, L>
impl<P: Clone, L: VolatileLink<Data<P>>> MajorityAckUniformReliableBroadcast<P, L>
Sourcepub fn with_link(
me: NodeId,
members: impl IntoIterator<Item = NodeId>,
link: L,
) -> Self
pub fn with_link( me: NodeId, members: impl IntoIterator<Item = NodeId>, link: L, ) -> Self
Broadcast among members, over the link supplied.
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 relayed id, for tests watching the majority form.
Trait Implementations§
Source§impl<P: Debug + Clone, L: Debug + VolatileLink<Data<P>>> Debug for MajorityAckUniformReliableBroadcast<P, L>
impl<P: Debug + Clone, L: Debug + VolatileLink<Data<P>>> Debug for MajorityAckUniformReliableBroadcast<P, L>
Source§impl<P: Clone, L> Protocol for MajorityAckUniformReliableBroadcast<P, L>where
L: VolatileLink<Data<P>>,
impl<P: Clone, L> Protocol for MajorityAckUniformReliableBroadcast<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 by resending on the establishment that follows.
Source§type Meta = Infallible
type Meta = Infallible
Keeps nothing durably: a crash loses everything this protocol knows.
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 link. The trait’s default would drop it.
Source§type Msg = <BestEffortBroadcast<Data<P>, L> as Protocol>::Msg
type Msg = <BestEffortBroadcast<Data<P>, L> as Protocol>::Msg
Source§type Entry = Infallible
type Entry = Infallible
Source§fn on_cmd(&mut self, Cmd::Broadcast: Cmd<P>, cx: &mut ProtoCx<'_, Self>)
fn on_cmd(&mut self, Cmd::Broadcast: Cmd<P>, cx: &mut ProtoCx<'_, Self>)
Source§fn on_msg(&mut self, from: NodeId, msg: Msg<P, L>, cx: &mut ProtoCx<'_, Self>)
fn on_msg(&mut self, from: NodeId, msg: Msg<P, L>, cx: &mut ProtoCx<'_, Self>)
from.