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