Changelog¶
This library adheres to Semantic Versioning 2.0.
Unreleased¶
Nothing changed yet.
4.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:
FixedWindowCounterLeakyBucketSlidingWindowLogBucketGroup
Rate Controllers (not considering the underlying buckets):
Scheduler
The __slots__ attribute was removed from all buckets and rate controllers,
for practical reasons.
4.1.0¶
Added the
NoopControllercontroller, that simply lets requests through.Improved the performance of the
Schedulerby better detecting availability conditions for queued requests, thus no longer requiring an internal lock.
4.0.0¶
Breaking change: Mixin helper methods were moved away from the
RateControllerabstract class.Breaking change: Now define
__slots__in all classes for better memory management
3.0.1¶
Allow passing kwargs in abstract
RateController.request(...).
3.0.0¶
Now allow passing no bucket argument to the rate controllers.
Breaking change: Removed the now obsolete
UnlimitedBucket.
2.0.0¶
Breaking changes¶
Unified the API for the rate controllers.
Now both the
RateLimiterand theScheduleruse the following signature:async with controller.request(tokens): ...The
RateLimitercan now also be instantiated in anasync with RateLimiter(...)statement.
Rate controllers now manage their bucket’s context in their
async withstatement, 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_contextflag in the constructor.The
rate_control.bucketsmodule is now private. TheRateControllerbase class, and all buckets, are now exported in the mainrate_controlmodule.
New Features¶
The
BucketGroupclass now implements theIterable[Bucket]protocol.
1.1.0¶
Added the ability to update the token capacity for FixedWindowCounter and SlidingWindowLog.
1.0.0¶
First release of the project