semvec/pypi-packages huggingface dataset:
gevent-requests 0.6.1
Use requests with gevent in your production
License: BSD


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]>]