Changes for governor
- The
MonotonicClockandSystemClockstruct definitions now are proper "empty" structs. Any non-Defaultconstruction of these clocks must now useMonotonicClockinstead ofMonotonicClock(). - The
clock::ReasonablyRealtimetrait got simplified and no longer has any required methods to implement, only one default method. - Replaced the
spincrate withparking_lotforno_stdcontexts.
[0.2.0] - 2020-03-01
-
This changelog!
-
New type
RateLimiter, superseding theDirectRateLimitertype. -
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:
-
Quotaconstructors now support a separate.allow_burstmethod that specifies a maximum burst capacity that diverges from the default. -
New constructor
Quota::with_periodallows specifying the exact amount of time it takes to replenish a single element.
- The
Quota::newconstructor 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 + 1to 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.