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

Should this be using asgiref.local.Local? #77

Open
uptickmetachu opened this issue Aug 27, 2024 · 1 comment
Open

Should this be using asgiref.local.Local? #77

uptickmetachu opened this issue Aug 27, 2024 · 1 comment

Comments

@uptickmetachu
Copy link

uptickmetachu commented Aug 27, 2024

With django being used in more async contexts should the threading local _thread_locals swap to using asgiref.local.Local?

Repository owner deleted a comment Aug 28, 2024
@zsoldosp
Copy link
Owner

@uptickmetachu I don't have active django projects with async, so don't have the immediate need for it

If you could adjust the tests and add async testcases to it (tests/testapp/tests.py, based on TestUserBase, TestSetUserToThread, CurrentUserFieldOnUpdateTestCase just create the async variant), I could take a look

Also, in non-django contexts I recall we used contextvars, which would have the benefit of having a single implementation that works both with sync and async setups. What do you think?

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

2 participants