The latest release of Quart, 0.6.0, changes Quart to be a pure ASGI framework and introduces Hypercorn as an ASGI server based on the serving code previously in Quart. This means that you can continue to use Hypercorn to serve Quart, or switch to any other ASGI framework-server combination.
What is ASGI?
ASGI, Asynchronous Server Gateway Interface, is a specification that defines how web servers can asynchronously interface with web applications or frameworks. It is inspired by WSGI, Web Server Gateway Interface, which has been actively used in Python since 2003. ASGI itself comes in two very distinct forms, the deprecated version 1.0 and the newer version 2.0 that Quart and Hypercorn implement.
WSGI was introduced at a time when Python had many web frameworks that were also servers. This was considered a problem as the choice of the framework limited the choice of web server and vice versa. This is the same position we are in today with async frameworks such as Sanic or AIOHTTP. This situation has arisen as the WSGI specification cannot be applied to async frameworks, however the ASGI specification can be.
As with the introduction of WSGI, the existence of ASGI does nothing to address the current state rather existing frameworks must adapt. Hopefully Quart doing so will encourage others to follow suite.
An ASGI server is responsible for receiving data as raw bytes and interpreting the bytes in terms of the HTTP or Websocket protocol. Once it has done so it can then send this information to the ASGI Framework.
An ASGI Framework is responsible for receiving messages from the ASGI server, acting on them and returning messages indicating how the server should respond.
Hypercorn is based on the very robust hyper, h11, h2, and wsproto libraries. It can also optionally be used with uvloop for additional performance. The intention is for Hypercorm to be a very robust ASGI server.
To use Hypercorn simply
pip install hypercorn and then run
hypercorn module:app replacing module and app with the name of the module an ASGI framework application is defined within. Otherwise see the Hypercorn docs.