title: Throttle and queue up API requests due to per second cap
body: <p>I'm use <a href="https://github.com/mikeal/request" rel="noreferrer">mikeal/request</a> to make API calls. One of the API's I use most frequently (the Shopify API). Recently put out a new <a href="http://docs.shopify.com/api/tutorials/learning-to-respect-the-api-call-limit" rel="noreferrer">call limit</a>, I'm seeing errors like: </p>
  
  <pre><code>Exceeded 6.0 calls per second for api client. Slow your requests or contact support for higher limits.
  </code></pre>
  
  <p>I've already gotten an upgrade, but regardless of how much bandwidth I get I have to account for this. A large majority of the requests to the Shopify API are within <a href="https://github.com/caolan/async" rel="noreferrer">async.map()</a> functions, which loop asynchronous requests, and gather the bodies.</p>
  
  <p>I'm looking for any help, perhaps a library that already exists, that would wrap around the request module and actually block, sleep, throttle, allocate, manage, the many simultaneous requests that are firing off asynchronously and limit them to say <code>6</code> requests at a time. I have no problem with working on such a project if it doesn't exist. I just don't know how to handle this kind of situation, and I'm hoping for some kind of standard.</p>
  
  <p>I made a ticket with <a href="https://github.com/mikeal/request/issues/716" rel="noreferrer">mikeal/request</a>.</p>