Skip to content

smol in sync / non-blocking context #297

Answered by notgull
Roms1383 asked this question in Q&A
Discussion options

You must be logged in to vote

You need to call run to drive the future. Executors on their own don't run, you need to drive them. For example:

std::thread::spawn(|| {
    smol::block_on(EXECUTOR.run(std::future::pending::<()>()));
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Roms1383
Comment options

Answer selected by Roms1383
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants