fparkan/vendor/flume/examples/simple.rs
Valentin Popov 1b6a04ca55
Initial vendor packages
Signed-off-by: Valentin Popov <valentin@popov.link>
2024-01-08 01:21:28 +04:00

19 lines
323 B
Rust

use std::thread;
fn main() {
let (tx, rx) = flume::unbounded();
let t = thread::spawn(move || {
for msg in rx.iter() {
println!("Received: {}", msg);
}
});
tx.send("Hello, world!").unwrap();
tx.send("How are you today?").unwrap();
drop(tx);
t.join().unwrap();
}