Is there a way to inspect the pending queue size?
Is there a way to inspect the pending queue size?
About sindresorhus/p-limit · 2 messages · last activity 6/8/2026
Yes, there is. According to the README, you can inspect the pending queue size using the limit.pendingCount property.
From the API documentation:
limit.pendingCount
The number of promises that are waiting to run (i.e. their internal
fnwas not called yet).
This property gives you the count of promises that have been submitted to the limiter but haven't started executing yet. This is useful for monitoring how many tasks are queued and waiting for concurrency slots to become available.
Similarly, if you want to know how many promises are currently running (not just pending), you can use limit.activeCount, which returns the number of promises that are currently executing.
FOLLOW_UPS:
- How does pendingCount change when a task completes?
- What's the relationship between activeCount and concurrency limit?
- Can you clear the pending queue without rejecting promises?
Want to ask your own question?
Open chat for sindresorhus/p-limit →Public Q&A. Generated by RepoPilot from the actual source of sindresorhus/p-limit. AI answers can be incomplete or stale — verify before relying on them.