sindresorhus / p-queue

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

How do I only add items up until the concurrency limit and then wait until a pending promise is fulfilled? #191

Open WayneEllery opened 1 year ago

WayneEllery commented 1 year ago

How do I only add items up until the concurrency limit and then wait until a pending promise is fulfilled? I couldn't work out how to do this? When I use .onSizeLessThan(1) it will wait when there is same number items as concurrency limit + 1 but I want to stop adding items when it hits the concurrency limit