Use requests with gevent in your production
Project description
Gevent-Requests allows you to use Requests with Gevent to make asynchronous HTTP Requests easily. And this project also allow your own custom useage with gevent in your production environment, for example your can use it with flask like:
>>> from gevent import monkey >>> monkey.patch_all(thread=False, select=False)
Usage
Usage is simple:
>>> # First patch the socket >>> import gevent_requests >>> urls = [ >>> 'http://www.heroku.com', >>> 'http://tablib.org', >>> 'http://httpbin.org', >>> 'http://python-requests.org', >>> 'http://kennethreitz.com' >>> ]
Create a set of unsent Requests:
>>> rs = (gevent_requests.get(u) for u in urls)
Send them all at the same time:
>>> gevent_requests.gmap(rs) [<Response [200]>, <Response [200]>, <Response [200]>, <Response [200]>, <Response [200]>]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gevent_requests-0.6.1.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for gevent_requests-0.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64e71a8987764ec48f1da1f10eee09fe870ca6ab3f164c612c072f07d3bb8b56 |
|
MD5 | e883892ed119c194073e034b0ad0d7ac |
|
BLAKE2b-256 | 8ad149634a0d583621a4a15980516014acab0b22ec9f20549c0d8f949e61f5a8 |