Created
March 23, 2022 16:58
-
-
Save stepancheg/0c1e6ed4b45a334a9a222e7db38537f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[tokio::main] | |
async fn main() { | |
let futs = (0..1000).map(|i| tokio::task::spawn(async move { i })); | |
for fut in futs { | |
# remove unconstraint, and it will block | |
let i = futures::executor::block_on(tokio::task::unconstrained(fut)).unwrap(); | |
eprintln!("{}", i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment