Asynchronous Server Gateway Interface

The Asynchronous Server Gateway Interface (ASGI) is a calling convention for web servers to forward requests to asynchronous-capable Python programming language frameworks, and applications. It is built as a successor to the Web Server Gateway Interface (WSGI).

ASGI Specification
Version3.0
DeveloperASGI Team
Release date2019-03-04[1]
Websiteasgi.readthedocs.io/en/latest/specs/index.html
Licensepublic domain[2]
StatusDraft

Where WSGI provided a standard for synchronous Python application, ASGI provides one for both asynchronous and synchronous applications, with a WSGI backwards-compatibility implementation and multiple servers and application frameworks.

Asynchronous Server Gateway Interface (ASGI) serversEdit

Below listed some complete or upcoming implementations of Asynchronous Server Gateway Interface (ASGI Specification) - web servers and frameworks.

DaphneEdit

Daphne is a Hypertext Transfer Protocol, HTTP2 and WebSocket protocol server for ASGI and ASGI-HTTP, developed to power Django (web framework) Channels. It supports automatic negotiation of protocols; there's no need for URL prefixing to determine WebSocket endpoints versus HTTP endpoints.[3]

UvicornEdit

Uvicorn is an ASGI web server implementation for Python (programming language). Uvicorn currently supports HTTP/1.1 and WebSockets.[4]

HypercornEdit

Hypercorn is an ASGI and WSGI web server based on the sans-io hyper, h11, h2, and wsproto libraries and inspired by Gunicorn. Hypercorn supports HTTP/1, HTTP/2, WebSockets (over HTTP/1 and HTTP/2), ASGI, and WSGI specifications. Hypercorn can utilise asyncio, uvloop, or trio worker types.[5]

Web Server Gateway Interface (WSGI) compatibilityEdit

ASGI is also designed to be a superset of WSGI, and there’s a defined way of translating between the two, allowing WSGI applications to be run inside ASGI servers through a translation wrapper (provided in the asgiref library). A threadpool can be used to run the synchronous WSGI applications away from the async event loop.

See alsoEdit

ReferencesEdit

  1. ^ "Version History".
  2. ^ "Copyright". Retrieved 2022-09-14.
  3. ^ "Daphne Website". Retrieved 2022-09-14.
  4. ^ "Uvicorn Website". Retrieved 2022-09-14.
  5. ^ "Hypercorn Website". Retrieved 2022-09-14.

External linksEdit