pub struct SendBuffer { /* private fields */ }Expand description
A broadcast-style send buffer. The outlet pushes samples in, and each consumer (TCP client session) gets its own queue.
Implementations§
Source§impl SendBuffer
impl SendBuffer
pub fn new() -> Arc<Self>
Sourcepub fn push_sample(&self, sample: Sample)
pub fn push_sample(&self, sample: Sample)
Push a sample to all consumers
Sourcepub fn push_sentinel(&self)
pub fn push_sentinel(&self)
Wake up consumers (e.g., during shutdown)
Sourcepub fn new_consumer(&self, max_buffered: usize) -> Receiver<Option<Sample>>
pub fn new_consumer(&self, max_buffered: usize) -> Receiver<Option<Sample>>
Register a new consumer and return its receiver
Sourcepub fn have_consumers(&self) -> bool
pub fn have_consumers(&self) -> bool
Check if there are active consumers
Sourcepub fn wait_for_consumers(&self, timeout: f64) -> bool
pub fn wait_for_consumers(&self, timeout: f64) -> bool
Wait until at least one consumer is registered
Auto Trait Implementations§
impl !Freeze for SendBuffer
impl !RefUnwindSafe for SendBuffer
impl Send for SendBuffer
impl Sync for SendBuffer
impl Unpin for SendBuffer
impl UnsafeUnpin for SendBuffer
impl UnwindSafe for SendBuffer
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