pub struct BlockingMpscRing;Expand description
Factory for an MPSC pool of N SPSC rings wired into the cross-process waker primitive.
Implementations§
Source§impl BlockingMpscRing
impl BlockingMpscRing
Sourcepub fn create_anon_pool(
n_producers: usize,
capacity: usize,
) -> Result<(Vec<BlockingMpscProducer>, BlockingMpscConsumer), BlockingError>
pub fn create_anon_pool( n_producers: usize, capacity: usize, ) -> Result<(Vec<BlockingMpscProducer>, BlockingMpscConsumer), BlockingError>
In-process pool: N producer rings + per-ring producer wakers
- one consumer waker, all anon-mapped.
Sourcepub fn create_pool(
path_prefix: impl AsRef<Path>,
n_producers: usize,
capacity: usize,
) -> Result<(Vec<BlockingMpscProducer>, BlockingMpscConsumer), BlockingError>
pub fn create_pool( path_prefix: impl AsRef<Path>, n_producers: usize, capacity: usize, ) -> Result<(Vec<BlockingMpscProducer>, BlockingMpscConsumer), BlockingError>
File-backed pool. Path layout:
<prefix>.ring.{i}.bin - SPSC ring for producer i
<prefix>.pw.{i}.bin - producer-side waker for ring i
<prefix>.cw.bin - shared consumer waker
Sourcepub fn open_pool(
path_prefix: impl AsRef<Path>,
n_producers: usize,
expected_capacity: usize,
) -> Result<(Vec<BlockingMpscProducer>, BlockingMpscConsumer), BlockingError>
pub fn open_pool( path_prefix: impl AsRef<Path>, n_producers: usize, expected_capacity: usize, ) -> Result<(Vec<BlockingMpscProducer>, BlockingMpscConsumer), BlockingError>
Open an existing file-backed pool. Caller passes the same
path_prefix, n_producers, and capacity the pool was
created with.
Auto Trait Implementations§
impl Freeze for BlockingMpscRing
impl RefUnwindSafe for BlockingMpscRing
impl Send for BlockingMpscRing
impl Sync for BlockingMpscRing
impl Unpin for BlockingMpscRing
impl UnsafeUnpin for BlockingMpscRing
impl UnwindSafe for BlockingMpscRing
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