traveltime-dev / traveltime-python-sdk

TravelTime SDK for Python programming language
https://docs.traveltime.com/
MIT License
20 stars 5 forks source link

Add automated rate limiting/throttling #29

Closed MxMartin closed 1 year ago

MxMartin commented 1 year ago

Currently when making more requests per minute than allowed, the SDK just returns an error message.

It'd be great if the SDK could throttle automatically according to e.g. a rate_limit paramter passed to the TravelTimeSdk class just like the limit_per_host parameter. An example on how to implement the throttling is given here: https://gist.github.com/hallazzang/d828e36ea6cf7ff476d033da0f15dec5

MxMartin commented 1 year ago

I created a pull request with a suggested solution for this: https://github.com/traveltime-dev/traveltime-python-sdk/pull/36