let (mut tx, mut rx) = mpsc::channel(10);
for i in 0i32..10 {
tx.send(i).await.unwrap();
}
drop(tx);
tokio::task::spawn_blocking(move || {
while let Some(received) = rx.optimistic_blocking_recv() {
let received = rx.optimistic_blocking_recv();
some_blocking_op(received);
}
})
.await
.unwrap();
-
Notifications
You must be signed in to change notification settings - Fork 0
License
onsails/tokio-non-async
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published