-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
Description
See #5256
async-await: https://flask.palletsprojects.com/en/stable/async-await/
Using async with greenlet
When using gevent or eventlet to serve an application or patch the runtime, greenlet>=1.0 is required. When using PyPy, PyPy>=7.3.7 is required.
Flask uses asgiref, which is not compatible with gevent: django/asgiref#443
BTW:
ASGI: https://flask.palletsprojects.com/en/stable/deploying/asgi/
The asgiref WsgiToAsgi adapter is recommended as it integrates with the event loop used for Flask’s Using async and await support.
This makes it seem like the event loop integration means a single worker could process multiple requests concurently, which it can't, the worker will block on await.
I'm not the only one that found this the hard way: Flask, Gunicorn, Gevent and Asyncio Don't Mix