Changes for governor
-
You can now alter&expand the information returned from a rate limiter by attaching middleware to it using
.with_middleware::<YourClass>()
at construction time.This is an incompatible change, as the type signature of RateLimiter gained an additional generic parameter. See the pull request and issue #66 for details.
- Updated the
Arc
guide section to useArc::clone()
instead oflimiter.clone()
. - Updated the
quanta
dependency to 0.8.0, speeding up the quanta clock by a bit. This changes the upkeep clock interface incompatibly: The quanta upkeep Builder structure got renamed toquanta::Upkeep
.
[0.3.2] - 2021-01-28
[0.3.1] - 2020-07-26
- A little section to the guide explaining how to use keyed rate limiters.
Several dependencies' minimum versions were bumped, including a
version bump of
smallvec
, a transitive
dependency which could previously result in trees using governor
pulling in a vulnerable smallvec version.
[0.3.0] - 2020-07-25
- The
ShrinkableKeyedStateStore
trait now has requiredlen
andis_empty
methods, which are also made available on anyRateLimiter
that uses a shrinkable (Hashmap / Dashmap backed) state store. Thanks to @lytefast for the idea and pull request onratelimit_meter
!
- The
MonotonicClock
andSystemClock
struct definitions now are proper "empty" structs. Any non-Default
construction of these clocks must now useMonotonicClock
instead ofMonotonicClock()
. - The
clock::ReasonablyRealtime
trait got simplified and no longer has any required methods to implement, only one default method. - Replaced the
spin
crate withparking_lot
forno_std
contexts.
[0.2.0] - 2020-03-01
-
This changelog!
-
New type
RateLimiter
, superseding theDirectRateLimiter
type. -
Support for keyed rate limiting in
RateLimiter
, which allows users to keep a distict rate limit state based on the value of a hashable element. -
Support for different state stores:
-
Support for different clock kinds:
-
Quota
constructors now support a separate.allow_burst
method that specifies a maximum burst capacity that diverges from the default. -
New constructor
Quota::with_period
allows specifying the exact amount of time it takes to replenish a single element.
- The
Quota::new
constructor has some very confusing modalities, and should not be used as-is.
- An off-by-one error in
check_n
, causing calls withn = burst_size + 1
to return a "not yet" result instead of a "this will never work" result.
0.1.2 - 2019-11-17
Initial release: A "direct" (a single rate-limiting state per structure) rate limiter that works in an async context, using atomic operations.