Created by: ross
What is this Python project?
Python 2/3 library for doing async http requests with python futures. It's strives to be completely API-compatible with requests, just returning futures objects wrapping the response rather than the response itself.
What's the difference between this Python project and similar ones?
Super easy to use, no event loops or anything like that to manage. Uses the new concurrent.futures
functionality in Python 3 and it's backport in Python 2.
from requests_futures.sessions import FuturesSession
session = FuturesSession()
# first request is started in background
future_one = session.get('http://httpbin.org/get')
# second request is started immediately
future_two = session.get('http://httpbin.org/get?foo=bar')
# wait for the first request to complete, if it hasn't already
response_one = future_one.result()
print('response one status: {0}'.format(response_one.status_code))
print(response_one.content)
# wait for the second request to complete, if it hasn't already
response_two = future_two.result()
print('response two status: {0}'.format(response_two.status_code))
print(response_two.content)
--
Anyone who agrees with this pull request could vote for it by adding a