|
PeanutButter
|
Provides a mechanism for rate-limiting calls to blocks of code. Calls made within limits are executed, those which exceed limits are dropped. More...
Public Member Functions | |
| void | Run (Action action) |
| Runs the synchronous code, rate-limited. | |
| Task | RunAsync (Func< Task > action) |
| Runs the asynchronous code, rate-limited. | |
| void | Reset () |
| Resets the sliding window of known calls. | |
Properties | |
| int | MaxCallsPerPeriod [get, set] |
| The configured max-calls-per-minute, which can be modified at runtime. | |
| TimeSpan | Period [get] |
| The configured period to rate limit over (read-only, for information only) | |
| int | CallsRunWithinLastPeriod [get] |
| Reports the number of calls which have been successfully run during the last sliding window period. | |
Provides a mechanism for rate-limiting calls to blocks of code. Calls made within limits are executed, those which exceed limits are dropped.
| void PeanutButter.Utils.IRateLimiter.Reset | ( | ) |
Resets the sliding window of known calls.
Implemented in PeanutButter.Utils.RateLimiter.
| void PeanutButter.Utils.IRateLimiter.Run | ( | Action | action | ) |
Runs the synchronous code, rate-limited.
| action |
Implemented in PeanutButter.Utils.RateLimiter.
| Task PeanutButter.Utils.IRateLimiter.RunAsync | ( | Func< Task > | action | ) |
Runs the asynchronous code, rate-limited.
| action |
Implemented in PeanutButter.Utils.RateLimiter.
|
get |
Reports the number of calls which have been successfully run during the last sliding window period.
Implemented in PeanutButter.Utils.RateLimiter.
|
getset |
The configured max-calls-per-minute, which can be modified at runtime.
Implemented in PeanutButter.Utils.RateLimiter.
|
get |
The configured period to rate limit over (read-only, for information only)
Implemented in PeanutButter.Utils.RateLimiter.