Skip to content
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

Use asgiref when available instead of thread locals #747

Closed
ThePumpingLemma opened this issue Nov 18, 2020 · 0 comments
Closed

Use asgiref when available instead of thread locals #747

ThePumpingLemma opened this issue Nov 18, 2020 · 0 comments

Comments

@ThePumpingLemma
Copy link
Collaborator

Problem Statement
Now that Django is gradually adding async support, thread locals should be eschewed in favor of locals that work in async context.

Describe the solution you'd like
We should use asgiref.local when it is available.

Describe alternatives you've considered
We could use contextvars directly, but this approach is simpler since asgiref is a dependency of newer Django versions.

Additional context
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant