denyhosts/clamav/libclamav_rust/.cargo/vendor/flume/examples/simple.rs

19 lines
323 B
Rust
Raw Normal View History

2023-01-14 18:28:39 +08:00
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();
}