v9.0.0
Added 10
- Add .onError() method
- Add .onPendingZero() method
- Add pendingZero event
- Add .runningTasks property
- Add .isSaturated property
- Add .onRateLimit() method
- Add .onRateLimitCleared() method
- Add .isRateLimited property
- Add rateLimit event
- Add rateLimitCleared event
Changed 1
- Rename carryoverConcurrencyCount option to carryoverIntervalCount
Fixed 4
- Fix stack overflow with many aborted tasks
- Fix interval cap race condition with high concurrency
- Fix interval timing when queue becomes empty between task additions
- Fix priority default handling for undefined values
Removed 2
- Require Node.js 20
- Remove throwOnTimeout option, timeouts now always throw
From p-queue
Breaking
- Require Node.js 20 b2600d5
- Remove
throwOnTimeoutoption - timeouts now always throw e48716f- It was a mistake to not throw on timeouts and the option made it complicated to handle types.
- If you really need the old behavior back:
const result = await queue.add(fn).catch(error => { if (error instanceof TimeoutError) { return undefined; } throw error; });
Improvements
- Rename
carryoverConcurrencyCountoption tocarryoverIntervalCounta6096de- The old name still works, but will be removed in the next major version.
- Add
.onError()7c27e1d - Add
.onPendingZero()(#230) 62efb74 - Add
pendingZeroevent (#230) 62efb74 - Add
.runningTasksfad8ee4 - Add
.isSaturatedfad8ee4 - Add
.onRateLimit()701453e - Add
.onRateLimitCleared()701453e - Add
.isRateLimited701453e - Add
rateLimitevent 701453e - Add
rateLimitClearedevent 701453e
Fixes
- Fix stack overflow with many aborted tasks 81cbae2
- Fix interval cap race condition with high concurrency 7fea658
- Fix interval timing when queue becomes empty between task additions 7b3f53e
- Fix priority default handling for undefined values 439d512
https://github.com/sindresorhus/p-queue/compare/v8.1.1...v9.0.0