a batch based request package with retry stratgy that enables you to send X requests concurrently at rate of Y requests/execution
Project description
Request Ray
a batch based request package with retry stratgy that enables you to send X requests concurrently at rate of Y requests/execution with max retries for each N
Setup
pip install request_ray
How to use
from request_ray import rray
requests = [{
'method': 'POST',
'url': 'https://google.com',
'kwargs': {'data': json.dumps({'hello': 'world'}), 'headers': {'alpha': 'beta'}}
}, {
'method': 'GET',
'url': 'https://facebook.com',
'kwargs': {}
}]
batch_size = 2 # max no of requests to send at a time
retry_policy = 3 # how many times to retry failed requests
responses rray.send_requests(requests, batch_size, retry_policy)
print(responses) # array of expected responses with structure in each element: {'index': 0, 'response': standard_response_object}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
request_ray-0.1.1.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for request_ray-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e251988eff0821a5ad1340564dca55e0b178838d96b43837d55516aabf152757 |
|
MD5 | 50ee7b7e0c1964d2aed7b69336557c61 |
|
BLAKE2b-256 | c7ae0d89f97e60b7a795ac465e862a2c83ce1440b393607a96595a41583be970 |