================
An easy way to seamlessly use Greenlet with Tornado.
----------------------------------------------------
This allows you to write code as if it were synchronous, and not worry about callbacks at all.
You also don't have to use any special patterns, such as writing everything as a generator.
Overall this allows you to structure your program in a much more sensible, straightforward way.
It's also immensely helpful when porting synchronous code to Tornado.
Derived from this blog article:
<http://blog.joshhaas.com/2011/06/marrying-boto-to-tornado-greenlets-bring-them-together/>
Install
-------
pip install greenlet_tornado
Example Usage:
--------------
import tornado.web
from greenlet_tornado import greenlet_asynchronous, greenlet_fetch
class ExampleHandler(tornado.web.RequestHandler):
@greenlet_asynchronous
def get(self):
# ...
self.helper()
# ...
self.write("Hello World!")
def helper(self):
# Fetch something. greenlet_fetch() will block until the request is complete,
# but the tornado IOLoop can do other things in the meantime.
http_response = greenlet_fetch("http://www.mopub.com")
# ... Do something with the response ...
Run tests
---------
pip install -r requirements_tests.txt
nosetests -s --cover-branches --cover-erase --with-coverage --cover-inclusive --cover-package=greenlet_tornado --tests=tests
Metadata
Release files for greenlet_tornado 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| greenlet_tornado-1.1.3.tar.gz | 5.1 kB | Without provenance | Details for greenlet_tornado-1.1.3.tar.gz |
Release files / greenlet_tornado-1.1.3.tar.gz
| Download URL | greenlet_tornado-1.1.3.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
285ff3f3b7871e469d8428442862d55c499f1d418ab26fb66addd059b13a8f71
|
|
BLAKE2b-256 checksum How to use checksums |
c1a4ddf5aa2a80616ca4a968c25223737002989874d2b8e5ab7f50cc344262b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for greenlet_tornado 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.