#36714: Async signals lose ContextVar state due to use of asyncio.gather
----------------------------------+------------------------------------
     Reporter:  Mykhailo Havelia  |                    Owner:  (none)
         Type:  Bug               |                   Status:  new
    Component:  HTTP handling     |                  Version:  dev
     Severity:  Normal            |               Resolution:
     Keywords:  asyncio, signals  |             Triage Stage:  Accepted
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+------------------------------------
Comment (by Mykhailo Havelia):

 Replying to [comment:18 Mykhailo Havelia]:
 > Replying to [comment:16 Carlton Gibson]:
 > > Being able to share the context between multiple concurrent
 sync_to_async tasks seems like something that's generally useful, and in-
 line with the create_task and TaskGroup API. So, that's a useful step
 independently I'd think. Thanks!
 >
 > Done https://github.com/django/asgiref/pull/536 😌

 I tested the updated asgiref with Django signals using my branch

 {{{
 pip install git+https://github.com/Arfey/asgiref.git@feat/added-custom-
 context-parameter-for-sync-to-async#egg=asgiref
 }}}

 Everything works correctly:

 {{{
 ./runtests.py signals
 Testing against Django installed in ... with up to 10 processes
 Found 28 test(s).
 ............................
 ----------------------------------------------------------------------
 Ran 28 tests in 0.333s
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36714#comment:19>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019a73d1ec7d-645045dc-5417-4a92-8efe-aee8aca9c55e-000000%40eu-central-1.amazonses.com.

Reply via email to