sindresorhus / p-queue

Promise queue with concurrency control
MIT License
3.39k stars 182 forks source link

Feature request: Ability to change interval and intervalCap at runtime #177

Open galaczi opened 1 year ago

galaczi commented 1 year ago

As far as I can tell currently there is no way to change the interval and/or intervalCap at runtime. Is there any chance for this to be implemented?

The current solution is great if you know in advance that you want to run tasks at a steady rate. However, in more dynamic use cases changing interval or intervalCap would be very useful.

nemphys commented 8 months ago

+1 In my use case, I am checking for some kind of cancellation condition during task runs and, based on that, I need to be able to cancel (fast-forward) the queue if the condition is true. The problem is that this queue needs an interval cap, which is still applied during fast-forwarding, leading to a considerable delay before the queue is flushed.