You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, contextvars -either stdlib's, or the objects in this project, offer a nice way to have each async task able to share contextual information (for example, information about an HTTP request) -
However, when doing asyncio programming a common pattern is to have some otherwise synchronous call to be executed in a thread-pool worker (for example, through an asyncio.loop.run_in_executor call).
The synch function called in this way is essentialy part of the task calling .run_in_executor - but there is no straightforward way to make the context variables in the main (async-) thread visible in the worker in the other threads. (any other thread starts with an empty context by default).
This is a natural fill-in for extra-context!
The text was updated successfully, but these errors were encountered:
Currently, contextvars -either stdlib's, or the objects in this project, offer a nice way to have each async task able to share contextual information (for example, information about an HTTP request) -
However, when doing asyncio programming a common pattern is to have some otherwise synchronous call to be executed in a thread-pool worker (for example, through an
asyncio.loop.run_in_executor
call).The synch function called in this way is essentialy part of the task calling
.run_in_executor
- but there is no straightforward way to make the context variables in the main (async-) thread visible in the worker in the other threads. (any other thread starts with an empty context by default).This is a natural fill-in for extra-context!
The text was updated successfully, but these errors were encountered: