-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Internalized thread sensitive context management in asgiref/sync.py
Rather than using an external context management function, this commit updates the thread_sensitive mode to reference an internal contextvar. This approach mainly allows for the thread executor to be shut down when the context exits, rather than relying on the thread pool shutting down when going out of scope. This approach also has other advantages: * Context variable management cannot be broken by omitting the current_context_func arg * This approach opens the door to more complex management techniques such as enforcing a thread pool limit.
- Loading branch information
Showing
4 changed files
with
120 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters