Timed promise queue / throttle
I have a request-promise function that makes a request to an API. I'm rate-limited by this API and I keep getting the error message: Exceeded 2 calls per second for api client. Reduce request rates to resume uninterrupted service. I'm running a couple of Promise.each loops in parallel which is causing the issue, if I run just one instance of Promise.each everything runs fine. Within these Promise.each calls they lead to the same function a with a request-promise call. I want to wrap this function with another queue function and set the interval to 500 milliseconds so that a request isn't made