Expand description
Crossbeam-style MPMC channel over crate::Queue.
Sender<T, N> and Receiver<T, N> are cloneable handles to a
shared backing crate::Queue. Multiple producers can hold their
own Sender; multiple consumers can hold their own Receiver.
The semantics match std::sync::mpsc / crossbeam::channel:
Sender::sendblocks until the queue accepts the item, or returnsError::NetClosedif all receivers have been dropped.Receiver::recvblocks until a producer sends, or returnsError::NetClosedif all senders have been dropped.Sender::try_send/Receiver::try_recvare non-blocking variants returningError::Timeoutwhen empty/full.
Variants:
- Heap mode (
channel) — convenience constructor that allocates the queue + a refcount on the heap. Requires theallocfeature. - Static mode (
Sender::from_static) — wraps a caller-owned&'static Queue<T, N>for zero-heap builds; refcount lives in a companion&'static AtomicUsizeyou provide.
Mirrors zephyr::sync::channel::{Sender, Receiver} but rides on
the existing ove_queue_* FFI so frames can bridge to C producers
/ consumers (the C side just calls ove_queue_send / _receive
and stays oblivious of the Rust-side refcount).
Structs§
- Receiver
- Multi-consumer half of an
ove::channel. - Sender
- Multi-producer half of an
ove::channel.
Functions§
- channel
- Construct a heap-allocated channel with one initial sender + one initial receiver. Clone either half to fan out.