use tokio::sync::mpsc;
#[tokio::main]
async fn main() {
let (tx, mut rx) = mpsc::channel(10);
tokio::spawn(async move {
tx.send("message").await.unwrap();
});
if let Some(msg) = rx.recv().await {
println!("Received: {}", msg);
}
} use tokio::sync::mpsc;
#[tokio::main]
async fn main() {
let (tx, mut rx) = mpsc::channel(10);
tokio::spawn(async move {
tx.send("message").await.unwrap();
});
if let Some(msg) = rx.recv().await {
println!("Received: {}", msg);
}
}