Function pipewire::channel::channel

source ·
pub fn channel<T>() -> (Sender<T>, Receiver<T>)where
    T: 'static,
Expand description

Create a Sender-Receiver pair, where the sender can be used to send messages to the receiver.

This functions similar to std::sync::mpsc, but with a receiver that can be attached to any LoopRef to have the loop invoke a callback with any new messages.

This can be used for inter-thread communication without shared state and where std::sync::mpsc can not be used because the receiving thread is running the pipewire loop.