async-std
async-std copied to clipboard
Cannot call task::block_on inside task::spawn
As title.
This is an issue opening from what we found in https://github.com/rmanoka/async-scoped/issues/2
Below is the code snippet that reproduce the problem, by the author of project there:
#[test]
fn test_recursive_block() {
task::block_on(async {
task::spawn(async {
task::block_on(async {
eprintln!("Hello block!");
})
});
})
}
for myself, I would like to see if there is any suggestion of spawning a scoped task so i can reaccess the variable without giving up ownership.