Use flume for lightweight async channels in Rust by creating a sender and receiver pair, then sending and receiving messages across async tasks.
use flume::bounded;
#[tokio::main]
async fn main() {
let (tx, rx) = bounded(10);
tokio::spawn(async move {
tx.send("hello").await.unwrap();
});
let msg = rx.recv().await.unwrap();
println!("{msg}");
}