Closed
Description
I have the following code:
// I don't control these parts. They come from a library:
async fn run() {
while let Some(data) = receiver.next().await {
process_data(data);
}
}
// This is the part that I get to control
fn process_data(data: Vec<u8>) {
// I need to run an async task here.
// So I do this:
task::block_on(async {
do_something_async_here().await;
});
}
The process_data
function crashes with the following error:
thread 'async-std/runtime' panicked at 'cannot run an executor inside another executor', <::std::macros::panic macros>:2:4
I think it might have to do with the switch to smol
, since I didn't face this issue earlier with 1.5. This happens only on 1.6. Please advice me on how to proceed.
Metadata
Metadata
Assignees
Labels
No labels