Opened 3 years ago
Closed 3 years ago
#32889 closed Cleanup/optimization (fixed)
Use asgiref ThreadSensitiveContext to allow per-request sync threads.
Reported by: | Carlton Gibson | Owned by: | Allan Feldman |
---|---|---|---|
Component: | HTTP handling | Version: | 4.0 |
Severity: | Normal | Keywords: | async, asgi |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
asgiref 3.3.2 added ThreadSensitiveContext allowing sync_to_async(thread_sensitive=True)
to be scoped per-request, rather than globally.
With Django 4.0 being 3.8+ the required contextvars
module is available.
Adjust ASGIHandler
to use ThreadSensitiveContext
Change History (2)
comment:1 by , 3 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:2 by , 3 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
In 36fa071: