Stream response with AsyncGenerator #5616
Unanswered
LorenzoVaccher01
asked this question in
Q&A
Replies: 1 comment 5 replies
-
@LorenzoVaccher01 Hello, is there any progress regarding this issue? I encountered a similar problem when trying to integrate the asynchronous streaming agent execution in Debugging middleware caught exception in streamed response at a point where response headers were already sent.
Traceback (most recent call last):
File "C:\Users\pengz\AppData\Roaming\Python\Python310\site-packages\werkzeug\wsgi.py", line 256, in __next__
return self._next()
File "C:\Users\pengz\AppData\Roaming\Python\Python310\site-packages\werkzeug\wrappers\response.py", line 32, in _iter_encoded
for item in iterable:
TypeError: 'async_generator' object is not iterable |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would need to stream data to the user via an endpoint through a function that returns an AsyncGenerator
The idea is as follows:
To be able to handle requests with async/await I installed
flask[async]
(3.0.3) but when I add async to themessage()
function I get the error:Beta Was this translation helpful? Give feedback.
All reactions