sync::mpsc — blocking channel. tokio::sync::mpsc — async channel.
sync::mpsc:
tokio::sync::mpsc:
1// Blocking2use std::sync::mpsc;3let (tx, rx) = mpsc::channel();4tx.send("hello").unwrap();56// Async7use tokio::sync::mpsc;8let (tx, mut rx) = mpsc::channel(32);9tx.send("hello").await.unwrap();
Key: std for blocking, tokio for async.