> module
std::sync
channels for sending values between threads
use std::sync; in the browser
std::sync provides channels for inter-thread communication. channel() returns a (Sender, Receiver) pair.
> functions
> types
> examples
use std::sync;
use std::thread;
use std::io;
fn main() {
let (tx, rx) = sync::channel();
thread::spawn(|| {
tx.send("hello from another thread").unwrap();
});
io::println("{}", rx.recv().unwrap());
}