Skip to content

How does current_thread runtime work? #6987

Answered by Darksonn
LIParadise asked this question in Q&A
Discussion options

You must be logged in to vote

When you use Handle::block_on, then that will execute the future you pass it, but the thread is not otherwise part of the runtime. No other futures are executed there. This applies to both current-thread and multi-thread.

Note that Runtime::block_on is slightly different. There, with the current-thread runtime, one of the block_on calls becomes where the real runtime is running. Any extra calls are just like Handle::block_on in that they execute the future they're given and nothing else.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@LIParadise
Comment options

@Darksonn
Comment options

Answer selected by LIParadise
@LIParadise
Comment options

@Darksonn
Comment options

@LIParadise
Comment options

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