Requests + Eventlet
ERequests allows you to use Requests with Eventlet to make asyncronous HTTP Requests easily.
ERequests is a port to Eventlet of Kenneth Reitz’s grequests (https://github.com/kennethreitz/grequests) though it doesn’t provide the same API these days.
Usage is simple:
import erequests 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 = (erequests.async.get(u) for u in urls)
Send them all at the same time:
>>> list(erequests.map(rs)) [<Response >, <Response >, <Response >, <Response >, <Response >]
NOTE: When sending multiple requests at the same time with map/imap, if any of them results in an error, the exception object is returned.
Installation is easy with pip:
$ pip install erequests
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size erequests-0.4.1.tar.gz (4.8 kB)||File type Source||Python version None||Upload date||Hashes View|