Module crossbeam::channel [−][src]
Multi-producer multi-consumer channels for message passing.
See the crossbeam-channel
crate for more
information.
Example
use std::thread; use crossbeam::channel as channel; let (s1, r1) = channel::unbounded(); let (s2, r2) = channel::unbounded(); thread::spawn(move || s1.send("foo")); thread::spawn(move || s2.send("bar")); // Only one of these two receive operations will be executed. select! { recv(r1, msg) => assert_eq!(msg, Some("foo")), recv(r2, msg) => assert_eq!(msg, Some("bar")), }
Re-exports
pub use crossbeam_channel::*; |
Macros
select |
Waits on a set of channel operations. |