https://github.com/saghul/evergreen-requests
Evergreen + Requests
https://github.com/saghul/evergreen-requests
Last synced: over 1 year ago
JSON representation
Evergreen + Requests
- Host: GitHub
- URL: https://github.com/saghul/evergreen-requests
- Owner: saghul
- License: bsd-2-clause
- Created: 2013-05-14T20:09:29.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-05-14T21:36:40.000Z (about 13 years ago)
- Last Synced: 2025-02-13T06:46:50.502Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 121 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
evergreen-requests
==================
This module contains an asynchronous replica of the ``requests`` API to be used together
with `evergreen `_, allowing you to make asynchronous HTTP requests easily.
All API methods return a ``Request`` instance (as opposed to ``Response``). A list of
requests can be sent with ``map()``.
This is a port to of Kenneth Reitz's `grequests `_ module.
Usage
-----
Usage is simple::
from evergreen.ext import 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 = (requests.get(u) for u in urls)
Send them all at the same time::
>>> list(requests.imap(rs))
[, , , , ]