Hi! Some days ago I opened this pull request [1] to automatically handle the rate limit in DigitalOcean [2], and want to get some feedback before merging it.
In DigitalOcean, each request has a 1h "lifetime", and you can perform up to 5000 "live" requests. When you hit that limit, you have to wait until the oldest request "dies" (1h after it was made) to have a free slot to perform one more request, etc. This rate limit implementation means that the impact of the rate limit depends a lot on how the API is used, and allows a progressive recovery when the limits are reached. The PR just implements it as an optional module, not enabled by default, that introduces an active wait until the oldest request expires, and then retries the rate limited request. There are also parameters to configure the maximum acceptable wait period and the max number of allowed retries. So, I would like some feedback on: * Has anyone faced rate limit issues? * Although the max wait period is configurable, the actual time needed to wait for a request could be near 1h if the rate limit is consumed rapidly, and in those cases waiting is not an option. On the other hand, it really depends on the client application and the use it makes of the API. Do you believe the common use cases and/or jclouds known consumers (Apache Brooklyn, the Jenkins plugin, etc) would benefit from this pull request? * Anything else to consider? I'd love to hear your opinion. Thx! I. [1] https://github.com/jclouds/jclouds-labs/pull/212 [2] https://developers.digitalocean.com/documentation/v2/#rate-limit