ASGI servers compatibility
To provide asynchronous support for the project, an ASGI server is necessary. The table below presents a summary of popular ASGI servers and their compatibility with this project.
ASGI compatibility
If there is an incompatibility listed in this table, your project will work with the server as you are used to. This plugin only handles lifespan events — if they are not provided by the ASGI server, the signals will not be handled.
The same should be valid for other ASGI servers not listed here. If you run into any problems, please file a Github issue.
ASGI server | Lifespan support | Lifespan scope state support |
---|---|---|
Uvicorn | Yes | Yes |
gunicorn with UvicornWorker1 | Yes | Yes |
Granian | Yes | Yes |
Hypercorn | Yes | Not compatible |
Daphne | Not compatible | not relevant |
Django runserver | Not compatible | not relevant |
NGINX Unit | Not yet tested | Not yet tested |
Uvicorn ¶
Uvicorn is the most tested ASGI server by the author of this plugin. The author uses uvicorn forĀ development, testing and production. In production it is perfectly fine to use uvicorn without gunicorn, see:
- https://stackoverflow.com/questions/66362199/what-is-the-difference-between-uvicorn-and-gunicornuvicorn/71546833
- https://github.com/encode/uvicorn/issues/303
Hypercorn¶
Hypercorn supports lifespan protocol. It does not support lifespan scope state, see these PRs:
Daphne¶
Daphne does not support the lifespan protocol at all. See this issue: https://github.com/django/daphne/issues/264.
You can use Daphne, but asynchronous start/shutdown signals will not be handled.
-
Please note that gunicorn does not support Windows (https://github.com/benoitc/gunicorn/issues/524). ↩