#32798: StreamingHttpResponse raises SynchronousOnlyOperation in ASGI server
--------------------------------+------------------------------------
     Reporter:  Ralph Broenink  |                    Owner:  nobody
         Type:  Bug             |                   Status:  new
    Component:  HTTP handling   |                  Version:  3.2
     Severity:  Normal          |               Resolution:
     Keywords:  ASGI, async     |             Triage Stage:  Accepted
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+------------------------------------

Comment (by Andrew Godwin):

 Yeah, this is an unfortunate confluence of the way that generators get
 called (and where they get called) in the response stack - they're called
 as sync generators, not async, but also are run in an async thread.

 I suspect we should probably look at running any response generators
 inside sync_to_async, unless we can detect they're an asynchronous
 generator somehow and then use `async for` instead of `for`?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32798#comment:2>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/065.22cfec55c27be4aab1957b011ad409a0%40djangoproject.com.

Reply via email to