pub struct Fanout { /* private fields */ }Expand description
A set of consumers that all receive the same sample.
liblsl calls this the send buffer (src/send_buffer.h). Each consumer holds
its own queue, so a slow consumer loses only its own samples. SPEC.md 8.8.
Implementations§
Source§impl Fanout
impl Fanout
Sourcepub fn add(&self, capacity: usize) -> Arc<SampleQueue>
pub fn add(&self, capacity: usize) -> Arc<SampleQueue>
Add a consumer with its own queue.
Sourcepub fn remove(&self, q: &Arc<SampleQueue>)
pub fn remove(&self, q: &Arc<SampleQueue>)
Remove a consumer.
Sourcepub fn push(&self, s: &Sample)
pub fn push(&self, s: &Sample)
Give one sample to every consumer.
A consumer that has gone away is dropped from the set. The call never waits, whatever any consumer is doing.
Sourcepub fn push_many(&self, samples: &[Sample])
pub fn push_many(&self, samples: &[Sample])
Give several samples to every consumer, with one lock for the set.
The result for each consumer is the same as one Fanout::push for each
sample, in order.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Fanout
impl RefUnwindSafe for Fanout
impl Send for Fanout
impl Sync for Fanout
impl Unpin for Fanout
impl UnsafeUnpin for Fanout
impl UnwindSafe for Fanout
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