Ravenports generated: 02 Dec 2019 21:21
[ravenports.git] / bucket_89 / python-asgiref
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-asgiref
4 VERSION=                3.2.3
5 KEYWORDS=               python
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]
12
13 DOWNLOAD_GROUPS=        main
14 SITES[main]=            PYPI/a/asgiref
15 DISTFILE[1]=            asgiref-3.2.3.tar.gz:main
16 DF_INDEX=               1
17 SPKGS[py37]=            single
18 SPKGS[py38]=            single
19 SPKGS[py27]=            single
20
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
26
27 DISTNAME=               asgiref-3.2.3
28
29 GENERATED=              yes
30
31 [PY37].USES_ON=                         python:py37
32
33 [PY38].USES_ON=                         python:py38
34
35 [PY27].USES_ON=                         python:py27
36
37 [FILE:3514:descriptions/desc.single]
38 asgiref
39 =======
40
41 .. image:: https://api.travis-ci.org/django/asgiref.svg
42     :target: https://travis-ci.org/django/asgiref
43
44 .. image:: https://img.shields.io/pypi/v/asgiref.svg
45     :target: https://pypi.python.org/pypi/asgiref
46
47 ASGI is a standard for Python asynchronous web apps and servers to
48 communicate
49 with each other, and positioned as an asynchronous successor to WSGI. You
50 can
51 read more at https://asgi.readthedocs.io/en/latest/
52
53 This package includes ASGI base libraries, such as:
54
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``
58
59
60 Function wrappers
61 -----------------
62
63 These allow you to wrap or decorate async or sync functions to call them
64 from
65 the other style (so you can call async functions from a synchronous thread,
66 or vice-versa).
67
68 In particular:
69
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.
73
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
76 synchronous
77   function completes.
78
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
81 from
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
84 (asynchronous)
85 ASGI server.
86
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.
90
91
92 Threadlocal replacement
93 -----------------------
94
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``.
99
100 If you instead want true thread- and task-safety, you can set
101 ``thread_critical`` on the Local object to ensure this instead.
102
103
104 Server base classes
105 -------------------
106
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
110 happening).
111
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
114 to
115 it. There's only one actual connection, but the server has to separate
116 things
117 into several scopes for easier writing of the code.
118
119 You can see an example of this being used in `frequensgi
120 <https://github.com/andrewgodwin/frequensgi>`_.
121
122
123 WSGI-to-ASGI adapter
124 --------------------
125
126 Allows you to wrap a WSGI application so it appears as a valid ASGI
127 application.
128
129 Simply wrap it around your WSGI application like so::
130
131     asgi_application = WsgiToAsgi(wsgi_application)
132
133 The WSGI application will be run in a synchronous threadpool, and the
134 wrapped
135 ASGI application will be one that accepts ``http`` class messages.
136
137 Please note that not all extended features of WSGI may be supported (such
138 as
139 file handles for incoming POST bodies).
140
141
142 Dependencies
143 ------------
144
145 ``asgiref`` requires Python 3.5 or higher.
146
147
148 Contributing
149 ------------
150
151
152
153 [FILE:99:distinfo]
154 7e06d934a7718bf3975acbf87780ba678957b87c7adc056f13b6215d610695a0        24295 asgiref-3.2.3.tar.gz
155