Skip to content

Releases: SGrondin/bottleneck

Fix .on()/.once() fix, Fix Group Cluster GC

24 Mar 18:00
Compare
Choose a tag to compare
  • Fixed .on() and .once() not returning the object itself, which broke "chaining" and compatibility with Node's own events. Fixes #59 , thanks @bkw for the bug report
  • Fixed key reuse for Groups when using Clustering. Fixes #57 , thanks @TheGame2500 for the bug report

Fix when using Cluster+Group+Expiration

18 Mar 18:33
Compare
Choose a tag to compare
  • Fixed an issue when using Clustering in a Group with maxConcurrent greater than 0 with jobs having an expiration time. A job timing out in a limiter in the group would lower the count of running jobs in all limiters in the group, which would result in going over the rate limit.
  • Improved the error message when returning a non-Promise value to schedule()

Babel, Clustering for Groups

13 Mar 01:07
Compare
Choose a tag to compare
  • Bottleneck v2 now ships code that is compatible with Node v6 instead of requiring Node v7.6. Thanks Babel.
  • Groups now support Clustering. Each limiter is automatically garbage collected, including its Redis data and even in the cases where Node loses connection to Redis.
  • Returning a promise to Bottleneck from within an event listener on a limiter now ensures your promise gets fully executed before exiting your program.
  • The depleted event now passes an empty argument.

`depleted` event, better Redis error

22 Feb 00:19
Compare
Choose a tag to compare
  • Added the depleted event. It is triggered when the reservoir reaches 0.
  • Return a friendly error message when a client tries to submit requests to a limiter which is still in the process of connecting to Redis and therefore cannot accept the request yet.

Fixed TypeScript issue with noImplicitAny

16 Jan 15:48
Compare
Choose a tag to compare
  • Fixed compilation when compiling using TypeScript and the --noImplicitAny compiler option

Version 2

14 Jan 19:00
Compare
Choose a tag to compare

Bottleneck Version 2

This new version is almost 100% compatible with Version 1 and it adds some powerful features such as:

  • True Clustering support. You can now rate limit and schedule jobs across multiple Node.js instances. It uses strictly atomic operations to stay reliable in the presence of unreliable clients. 100% of Bottleneck's features are supported.
  • Support for custom job weights. Not all jobs are equally resource intensive.
  • Support for job timeouts. Bottleneck can automatically cancel jobs if they exceed their execution time limit.
  • Many improvements to the interface, such as better method names and errors, improved debugging tools.

Upgrading to v2

The internal algorithms essentially haven't changed from v1, but many small changes to the interface were made to introduce new features.

All the breaking changes:

  • Bottleneck v2 uses ES6/ES2015. v1 will continue to use ES5 only.
  • The Bottleneck constructor now takes an options object.
  • Jobs take an optional options object.
  • Removed submitPriority(), use submit() with an options object instead.
  • Removed schedulePriority(), use schedule() with an options object instead.
  • The rejectOnDrop option is now true by default.
  • Use null instead of 0 to indicate an unlimited maxConcurrent value.
  • Use null instead of -1 to indicate an unlimited highWater value.
  • Renamed changeSettings() to updateSettings(), it now returns a promise to indicate completion. It takes the same options object as the constructor.
  • Renamed nbQueued() to queued().
  • Renamed nbRunning to running(), it now returns its result using a promise.
  • Removed isBlocked().
  • Changing the Promise library is now done through the options object like any other limiter setting.
  • Removed changePenalty(), it is now done through the options object like any other limiter setting.
  • Removed changeReservoir(), it is now done through the options object like any other limiter setting.
  • Removed stopAll(). Use the reservoir feature to disable execution instead.
  • check() now accepts an optional weight argument, and returns its result using a promise.
  • The Cluster feature is now called Group. This is to distinguish it from the new v2 Clustering feature.
  • The Group constructor takes an options object to match the limiter constructor.
  • Renamed the Group changeTimeout() method to updateSettings(), it now takes an options object.

Version 2 is more user-friendly, powerful and reliable.

Version 2: beta 4

29 Dec 22:00
Compare
Choose a tag to compare
Version 2: beta 4 Pre-release
Pre-release
v2.0.0-beta.4

2.0.0-beta.4

Version 2: beta 3

28 Dec 18:55
Compare
Choose a tag to compare
Version 2: beta 3 Pre-release
Pre-release
v2.0.0-beta.3

2.0.0-beta.3

Version 2: beta 2

27 Dec 17:41
Compare
Choose a tag to compare
Version 2: beta 2 Pre-release
Pre-release
v2.0.0-beta.2

2.0.0-beta.2

Version 2: beta 1

17 Dec 04:38
Compare
Choose a tag to compare
Version 2: beta 1 Pre-release
Pre-release
v2.0.0-beta.1

2.0.0-beta.1