We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using AsyncApp and a route returns an async generator I get the error : AttributeError: 'coroutine' object has no attribute 'encode'
AsyncApp
AttributeError: 'coroutine' object has no attribute 'encode'
for example :
async def route(): async def gen(): while True: yield json.dumps({'msg': 'Hello World!'}) + '\n\n' await asyncio.sleep(0.5) return StreamingResponse(gen())
When the generator is not async everything works fine.
When the generator is not async and using AsyncApp StreamingResponse is needed but when using FlaskApp returning the generator directly works fine.
FlaskApp
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
When using
AsyncApp
and a route returns an async generator I get the error :AttributeError: 'coroutine' object has no attribute 'encode'
for example :
When the generator is not async everything works fine.
When the generator is not async and using
AsyncApp
StreamingResponse is neededbut when using
FlaskApp
returning the generator directly works fine.The text was updated successfully, but these errors were encountered: