[Django] #31852: Support async generators in StreamingHttpResponse

14 views
Skip to first unread message

Django

unread,
Aug 4, 2020, 6:00:02 AM8/4/20
to django-...@googlegroups.com
#31852: Support async generators in StreamingHttpResponse
-----------------------------------------+------------------------
Reporter: Pike | Owner: nobody
Type: Uncategorized | Status: new
Component: HTTP handling | Version: 3.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
The DEP for async menytions that async generators should be supported in
StreamingHttpResponse.

After some digging, it seems that at least StreamingHttpResponse itself
and ASGIHandler.send_response need changes to support that?

--
Ticket URL: <https://code.djangoproject.com/ticket/31852>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 4, 2020, 6:58:49 AM8/4/20
to django-...@googlegroups.com
#31852: Support async generators in StreamingHttpResponse
-------------------------------+--------------------------------------
Reporter: Axel Hecht | Owner: nobody
Type: New feature | Status: closed

Component: HTTP handling | Version: 3.1
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Carlton Gibson):

* cc: Andrew Godwin (added)
* status: new => closed
* resolution: => needsinfo
* type: Uncategorized => New feature


Comment:

Yes, this is probably something we should take as a new feature, but it's
a little undefined at the moment.

Can I point you to the Forum Async topic:
https://forum.djangoproject.com/c/internals/async/8https://forum.djangoproject.com/c/internals/async/8
That's a good place to discuss it, and get fleshed out what would be
required.

I'll cc Andrew, as maybe he already has thoughts.

--
Ticket URL: <https://code.djangoproject.com/ticket/31852#comment:1>

Django

unread,
Aug 6, 2020, 2:40:42 PM8/6/20
to django-...@googlegroups.com
#31852: Support async generators in StreamingHttpResponse
-------------------------------+--------------------------------------
Reporter: Axel Hecht | Owner: nobody
Type: New feature | Status: closed
Component: HTTP handling | Version: 3.1
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Andrew Godwin):

We definitely should expand to add this, but async generators are quite
tough to support across a range of Python versions; they get increasingly
better to use every version. I think the best approach here would be an
exploratory patch to see what we can get that looks reasonable given
Django's current supported Python versions - 3.6 might be a high enough
baseline (3.5 is very problematic), but it might be a thing that's easier
in a future 3.7+ release.

--
Ticket URL: <https://code.djangoproject.com/ticket/31852#comment:2>

Django

unread,
Jan 28, 2023, 9:25:55 PM1/28/23
to django-...@googlegroups.com
#31852: Support async generators in StreamingHttpResponse
-------------------------------+--------------------------------------
Reporter: Axel Hecht | Owner: nobody
Type: New feature | Status: closed
Component: HTTP handling | Version: 3.1
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Tim Graham):

#34300 requested this again, pointing to an implementation at
https://pypi.org/project/django-async-stream/.

--
Ticket URL: <https://code.djangoproject.com/ticket/31852#comment:3>

Django

unread,
Jan 28, 2023, 10:26:56 PM1/28/23
to django-...@googlegroups.com
#31852: Support async generators in StreamingHttpResponse
-------------------------------+--------------------------------------
Reporter: Axel Hecht | Owner: nobody
Type: New feature | Status: closed
Component: HTTP handling | Version: 3.1
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Simon Charette):

Isn't this supported in 4.2 via (0bd2c0c9015b53c41394a1c0989afbfd94dc2830)
#33735?

--
Ticket URL: <https://code.djangoproject.com/ticket/31852#comment:4>

Reply all
Reply to author
Forward
0 new messages