echonest/enios — pull request #4 by newyankeecodeshop (2014-08-28 19:28:56+00:00)
Title: A request queue that understands "metering"

This pull request introduces an `ENAPIRequestQueue` class which can be used to queue up multiple API requests and make sure they are executed within the developer's API rate limit. The queue exposes the same API for making GET requests as `ENAPIRequest`. Calling the method will add the request to the queue. When a response comes back, the queue looks at the rate limit headers and detects when the API limit has been reached. The queue then waits a minute until the limit resets back to zero and starts making requests again. The queue also has limits the number of simultaneous requests to prevent the application from using too many connections at once.