https://github.com/envato/batch_retry
Batch send data with retries and exponential backoff
https://github.com/envato/batch_retry
Last synced: 8 months ago
JSON representation
Batch send data with retries and exponential backoff
- Host: GitHub
- URL: https://github.com/envato/batch_retry
- Owner: envato
- License: mit
- Created: 2017-11-01T04:57:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-15T03:58:12.000Z (over 8 years ago)
- Last Synced: 2025-01-26T15:36:21.326Z (over 1 year ago)
- Language: Python
- Size: 15.6 KB
- Stars: 2
- Watchers: 70
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Batch Retry
This library provides an interface to submit a batch of records to an API, which retries all failed records with an exponential backoff. Currently it just supports Kinesis using the [PutRecords](http://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecords.html) API method, but it can be used to support more APIs.
Usage:
```
from batch_retry import BatchRetry
from batch_retry import KinesisProcessor
def main():
kinesis_client = boto3.client('kinesis')
send_function = KinesisProcessor(kinesis_client, 'my-stream', batch_size=250).send
BatchRetry(send_function, retries=5).send_with_retries(['my_first_record'])
```
## Development Status
We don't recommend using it in production
## Installing
`pip install batch_retry`
Or add it to your `requirements.txt` file
## Contributing
For bug fixes, documentation changes, and small features:
1. Fork it ( https://github.com/envato/batch_retry/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
For larger new features: Do everything as above, but first also make contact with the project maintainers to be sure your change fits with the project direction and you won't be wasting effort going in the wrong direction
### Running tests
```
python setup.py test
```