Skip to content

Releases: corentin-regent/rate-control

v4.1.1

10 May 08:45
Compare
Choose a tag to compare

A RuntimeError is now raised when entering context managers more than once,
for objects for which it would cause undefined behavior.
Impacted classes are the following:

  • Buckets:

  • FixedWindowCounter

  • LeakyBucket

  • SlidingWindowLog

  • BucketGroup

  • Rate Controllers (not considering the underlying buckets):

  • Scheduler

The __slots__ attribute was removed from all buckets and rate controllers,
for practical reasons <https://stackoverflow.com/a/53089249>_.

v4.1.0

04 May 07:19
Compare
Choose a tag to compare
  • Added the NoopController controller, that simply lets requests through.

  • Improved the performance of the Scheduler by better
    detecting availability conditions for queued requests,
    thus no longer requiring an internal lock.

v4.0.0

30 Apr 11:59
Compare
Choose a tag to compare
  • Breaking change: Mixin helper methods were moved away from the RateController abstract class.

  • Breaking change: Now define __slots__ in all classes for better memory management

v3.0.1

27 Apr 08:01
Compare
Choose a tag to compare
  • Allow passing kwargs in abstract RateController.request(...).

v3.0.0

21 Apr 05:07
Compare
Choose a tag to compare
  • Now allow passing no bucket argument to the rate controllers.

  • Breaking change: Removed the now obsolete UnlimitedBucket.

v2.0.0

16 Apr 18:31
Compare
Choose a tag to compare

Breaking changes
^^^^^^^^^^^^^^^^

  • Unified the API for the rate controllers.

  • Now both the RateLimiter and the Scheduler use the following signature:
    async with controller.request(tokens): ...

  • The RateLimiter can now also be instantiated in an async with RateLimiter(...) statement.

  • Rate controllers now manage their bucket's context in their async with statement,
    so that we don't need to enter manually the bucket's context and then the rate controller's context.
    This behavior can be disabled using the should_enter_context flag in the constructor.

  • The rate_control.buckets module is now private.
    The RateController base class, and all buckets,
    are now exported in the main rate_control module.

New Features
^^^^^^^^^^^^

  • The BucketGroup class now implements the Iterable[Bucket] protocol.

v1.1.0

31 Mar 06:43
Compare
Choose a tag to compare

Added the ability to update the token capacity for FixedWindowCounter and SlidingWindowLog.

v1.0.0

13 Mar 16:37
Compare
Choose a tag to compare

First release of the project