Rate-control

Latest version: v4.1.0

Safety actively analyzes 624038 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

4.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.

4.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

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 ``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.

1.1.0

-----

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

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.