Skip to main content

Requests + Eventlet

Project description

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

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 [200]>, <Response [200]>, <Response [200]>, <Response [200]>, <Response [200]>]

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

Installation is easy with pip:

$ pip install erequests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

erequests-0.4.0.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file erequests-0.4.0.tar.gz.

File metadata

  • Download URL: erequests-0.4.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for erequests-0.4.0.tar.gz
Algorithm Hash digest
SHA256 6d8e288f4dd8806700fd748ac7585ee5f5284cadbbb3eecf6962a3492e4c6390
MD5 b8c4d85e7c44792707eb12ecc9409e6c
BLAKE2b-256 7e079631ceb131b15d8aa9c7ab2f5d958136c6788f9b960a21529c6f0dd3fd2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page