jhurliman / node-rate-limiter

A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled
MIT License
1.51k stars 135 forks source link

Any way to force a task to the front of the queue? #49

Open Kinzi opened 6 years ago

Kinzi commented 6 years ago

I have to limit requests by user. Let's say a user has a queue with 10 background tasks lined up. Is there a way to push a single manual request to the top of the queue so it get's executed next before the rest of the background jobs?

jhurliman commented 6 years ago

Right now it is first come first serve. I would be open to a new method that adds a task to the front of the list instead of the back if it gets rate limited.