pub struct BackpressureAwareProducer { /* private fields */ }Expand description
A rate-aware producer that respects backpressure.
Implementations§
Source§impl BackpressureAwareProducer
impl BackpressureAwareProducer
Sourcepub fn new(strategy: BackpressureStrategy, capacity: usize) -> Self
pub fn new(strategy: BackpressureStrategy, capacity: usize) -> Self
Creates a new backpressure-aware producer.
Sourcepub fn with_adaptive(self) -> Self
pub fn with_adaptive(self) -> Self
Enables adaptive rate control.
Sourcepub fn state(&self) -> BackpressureState
pub fn state(&self) -> BackpressureState
Returns the current state.
Sourcepub fn recommended_delay(&self) -> Duration
pub fn recommended_delay(&self) -> Duration
Returns the recommended delay before the next send.
Sourcepub fn record_dropped(&self, count: u64)
pub fn record_dropped(&self, count: u64)
Records dropped items.
Sourcepub fn stats(&self) -> BackpressureStats
pub fn stats(&self) -> BackpressureStats
Returns statistics.
Auto Trait Implementations§
impl !Freeze for BackpressureAwareProducer
impl RefUnwindSafe for BackpressureAwareProducer
impl Send for BackpressureAwareProducer
impl Sync for BackpressureAwareProducer
impl Unpin for BackpressureAwareProducer
impl UnwindSafe for BackpressureAwareProducer
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