-
-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
missing feature: task- and run-local storage #2
Comments
While we're at it we should probably have "run local" storage too: a place to stash stuff that's local to this run, and which automatically disappears when the run ends. Example: the Technically this is possible to fake already by using thread-local storage + a system task for notification of the run shutdown, but there's no reason to make this that difficult. |
Then again, it's also possible to fake run-local storage by just setting a task-local storage key early on (like in your main task) and then letting it be inherited by all child tasks... though this does waste some memory if you have lots of tasks. |
Similar to what I implemented in curio
It'd be nice if
run_in_worker_thread
preserved the task-local context.The text was updated successfully, but these errors were encountered: