mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-25 20:13:09 +00:00
20 lines
339 B
Rust
20 lines
339 B
Rust
|
use futures_channel::mpsc::unbounded;
|
||
|
|
||
|
#[async_std::test]
|
||
|
async fn channels() {
|
||
|
let (sender, mut receiver) = unbounded::<u32>();
|
||
|
|
||
|
// drop(sender);
|
||
|
|
||
|
match receiver.try_next() {
|
||
|
Ok(a) => {
|
||
|
dbg!(a);
|
||
|
}
|
||
|
Err(no) => {
|
||
|
dbg!(no);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
sender.unbounded_send(1).unwrap();
|
||
|
}
|