1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= python-asgiref
6 VARIANTS= py27 py38 py37
7 SDESC[py37]= ASGI specs, helper code, and adapters (PY 37)
8 SDESC[py38]= ASGI specs, helper code, and adapters (PY 38)
9 SDESC[py27]= ASGI specs, helper code, and adapters (PY 27)
10 HOMEPAGE= https://github.com/django/asgiref/
11 CONTACT= Python_Automaton[python@ironwolf.systems]
14 SITES[main]= PYPI/a/asgiref
15 DISTFILE[1]= asgiref-3.2.3.tar.gz:main
21 OPTIONS_AVAILABLE= PY27 PY38 PY37
22 OPTIONS_STANDARD= none
23 VOPTS[py37]= PY27=OFF PY38=OFF PY37=ON
24 VOPTS[py38]= PY27=OFF PY38=ON PY37=OFF
25 VOPTS[py27]= PY27=ON PY38=OFF PY37=OFF
27 DISTNAME= asgiref-3.2.3
31 [PY37].USES_ON= python:py37
33 [PY38].USES_ON= python:py38
35 [PY27].USES_ON= python:py27
37 [FILE:3514:descriptions/desc.single]
41 .. image:: https://api.travis-ci.org/django/asgiref.svg
42 :target: https://travis-ci.org/django/asgiref
44 .. image:: https://img.shields.io/pypi/v/asgiref.svg
45 :target: https://pypi.python.org/pypi/asgiref
47 ASGI is a standard for Python asynchronous web apps and servers to
49 with each other, and positioned as an asynchronous successor to WSGI. You
51 read more at https://asgi.readthedocs.io/en/latest/
53 This package includes ASGI base libraries, such as:
55 * Sync-to-async and async-to-sync function wrappers, ``asgiref.sync``
56 * Server base classes, ``asgiref.server``
57 * A WSGI-to-ASGI adapter, in ``asgiref.wsgi``
63 These allow you to wrap or decorate async or sync functions to call them
65 the other style (so you can call async functions from a synchronous thread,
70 * AsyncToSync lets a synchronous subthread stop and wait while the async
71 function is called on the main thread's event loop, and then control is
72 returned to the thread when the async function is finished.
74 * SyncToAsync lets async code call a synchronous function, which is run in
75 a threadpool and control returned to the async coroutine when the
79 The idea is to make it easier to call synchronous APIs from async code and
80 asynchronous APIs from synchronous code so it's easier to transition code
82 one style to the other. In the case of Channels, we wrap the (synchronous)
83 Django view system with SyncToAsync to allow it to run inside the
87 Note that exactly what threads things run in is very specific, and aimed to
88 keep maximum compatibility with old synchronous code. See
89 "Synchronous code & Threads" below for a full explanation.
92 Threadlocal replacement
93 -----------------------
95 This is a drop-in replacement for ``threading.local`` that works with both
96 threads and asyncio Tasks. Even better, it will proxy values through from a
97 task-local context to a thread-local context when you use ``sync_to_async``
98 to run things in a threadpool, and vice-versa for ``async_to_sync``.
100 If you instead want true thread- and task-safety, you can set
101 ``thread_critical`` on the Local object to ensure this instead.
107 Includes a ``StatelessServer`` class which provides all the hard work of
108 writing a stateless server (as in, does not handle direct incoming sockets
109 but instead consumes external streams or sockets to work out what is
112 An example of such a server would be a chatbot server that connects out to
113 a central chat server and provides a "connection scope" per user chatting
115 it. There's only one actual connection, but the server has to separate
117 into several scopes for easier writing of the code.
119 You can see an example of this being used in `frequensgi
120 <https://github.com/andrewgodwin/frequensgi>`_.
126 Allows you to wrap a WSGI application so it appears as a valid ASGI
129 Simply wrap it around your WSGI application like so::
131 asgi_application = WsgiToAsgi(wsgi_application)
133 The WSGI application will be run in a synchronous threadpool, and the
135 ASGI application will be one that accepts ``http`` class messages.
137 Please note that not all extended features of WSGI may be supported (such
139 file handles for incoming POST bodies).
145 ``asgiref`` requires Python 3.5 or higher.
154 7e06d934a7718bf3975acbf87780ba678957b87c7adc056f13b6215d610695a0 24295 asgiref-3.2.3.tar.gz