Releases: SGrondin/bottleneck
Releases · SGrondin/bottleneck
Type definitions and Cluster.changeTimeout()
- Added TypeScript type definitions thanks to @alexperovich
- Added
Cluster.changeTimeout()
Fixed missing args in 'dropped' event from schedule()
- Propagate the arguments coming from
promise()
/promisePriority()
into the task runner so that thedropped
event shows the arguments that were given to Bottleneck.
Safer stopAll()
- Changed internal representation of jobs tracking from a sparse array to an object. Fixes #25
- Instead of disabling
submit
/submitPriority
/schedule
/schedulePriority
,stopAll()
now makes those functions automatically reject any new requests with a descriptive error. This should save a lot of frustration and help users debug their programs.
'idle' event, removeAllListeners(), nbRunning()
- Added the
idle
event. It is emitted when bothnbQueued()
andnbRunning()
drop to0
, which means there is nothing running and nothing queued up. - Added the
removeAllListeners()
method which follows the same pattern as the standard Node.js method of the same name. It supports an optional event name as first argument. - Added the
nbRunning()
method which returns the number of requests currently running in the limiter.
Fixed issue with callbacks and rejectOnDrop
- Fixed an issue where the callback arguments when using
rejectOnDrop
withsubmit
andsubmitPriority
would be shifted when the job would be dropped.
Added rejectOnDrop
- Added a new constructor parameter:
rejectOnDrop
. When set to true, dropped jobs will be failed/rejected with theError
This job has been dropped by Bottleneck
.
Changed high water default
- Default highWater value went from
0
(unlimited) to-1
(unlimited). This makes it possible to create limiters that drop anything that would have gone into the queue, in order words settinghighWater
to0
will create a limiter that will only accept requests that will be executed immediately.
Added support for events
- Added
.on('empty', callback)
- Added
.on('dropped', callback)
Fixed documentation
Bottleneck.Promise = ...
-->Bottleneck.prototype.Promise