Releases: corentin-regent/rate-control
v4.1.1
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
-
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
-
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
- Allow passing kwargs in abstract
RateController.request(...)
.
v3.0.0
-
Now allow passing no bucket argument to the rate controllers.
-
Breaking change: Removed the now obsolete
UnlimitedBucket
.
v2.0.0
Breaking changes
^^^^^^^^^^^^^^^^
-
Unified the API for the rate controllers.
-
Now both the
RateLimiter
and theScheduler
use the following signature:
async with controller.request(tokens): ...
-
The
RateLimiter
can now also be instantiated in anasync 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 theshould_enter_context
flag in the constructor. -
The
rate_control.buckets
module is now private.
TheRateController
base class, and all buckets,
are now exported in the mainrate_control
module.
New Features
^^^^^^^^^^^^
- The
BucketGroup
class now implements theIterable[Bucket]
protocol.
v1.1.0
Added the ability to update the token capacity for FixedWindowCounter
and SlidingWindowLog
.
v1.0.0
First release of the project