Changes between Version 1 and Version 3 of Ticket #36916
- Timestamp:
- Feb 10, 2026, 10:37:28 AM (4 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36916
- Property Owner removed
- Property Status assigned → new
-
Ticket #36916 – Description
v1 v3 2 2 https://github.com/django/new-features/issues/117 3 3 4 ### Feature Description5 4 6 see https://forum.djangoproject.com/t/streamingresponse-driven-by-a-taskgroup/40320/4 5 === Feature Description === 7 6 8 I'd like to be able to write code that combines multiple streams of data: 9 ```py 7 see https://forum.djangoproject.com/t/streamingresponse-driven-by-a-taskgroup/40320/4 8 9 I’d like to be able to write code that combines multiple streams of data: 10 11 12 {{{ 10 13 async def news_and_weather(request: HttpRequest) -> StreamingHttpResponse: 11 14 async def gen() -> AsyncGenerator[bytes]: … … 24 27 yield msg # yield in async generator!! illegal inside TaskGroup! 25 28 return StreamingHttpResponse(gen()) 26 ``` 29 }}} 27 30 28 31 29 32 30 ### Problem 33 === Problem === 31 34 32 35 however this doesn’t work because I’m using a yield inside an async generator that’s not a context manager, and calling aclosing() on that async generator is not sufficient to allow a TaskGroup to cancel itself and catch the cancel error. 33 36 34 ```py35 37 38 39 {{{ 36 40 from useful_types import SupportsAnext 37 41 … … 65 69 66 70 return StreamingAcmgrHttpResponse(acmgr_gen()) 67 ``` 71 }}} 68 72 69 ### Implementation Suggestions 73 74 === Implementation Suggestions === 70 75 71 76 https://github.com/django/django/pull/19364/changes