pub struct TransmitLimitedQueue<B: Broadcast, N> { /* private fields */ }Expand description
Used to queue messages to broadcast to the cluster (via gossip) but limits the number of transmits per message. It also prioritizes messages with lower transmit counts (hence newer messages).
Implementations§
Source§impl<B: Broadcast, N: NodeCalculator> TransmitLimitedQueue<B, N>
impl<B: Broadcast, N: NodeCalculator> TransmitLimitedQueue<B, N>
Sourcepub fn new(retransmit_mult: usize, calc: N) -> Self
pub fn new(retransmit_mult: usize, calc: N) -> Self
Creates a new TransmitLimitedQueue.
Sourcepub async fn num_queued(&self) -> usize
pub async fn num_queued(&self) -> usize
Returns the number of messages queued.
Sourcepub async fn get_broadcasts(&self, limit: usize) -> TinyVec<B::Message>
pub async fn get_broadcasts(&self, limit: usize) -> TinyVec<B::Message>
Returns the messages can be broadcast.
Sourcepub async fn queue_broadcast(&self, b: B)
pub async fn queue_broadcast(&self, b: B)
Used to enqueue a broadcast
Auto Trait Implementations§
impl<B, N> !Freeze for TransmitLimitedQueue<B, N>
impl<B, N> !RefUnwindSafe for TransmitLimitedQueue<B, N>
impl<B, N> Send for TransmitLimitedQueue<B, N>
impl<B, N> Sync for TransmitLimitedQueue<B, N>
impl<B, N> Unpin for TransmitLimitedQueue<B, N>
impl<B, N> UnsafeUnpin for TransmitLimitedQueue<B, N>where
N: UnsafeUnpin,
impl<B, N> UnwindSafe for TransmitLimitedQueue<B, N>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more