FixedWindowRateLimiter Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
RateLimiter implementation that refreshes allowed permits in a window periodically.
public sealed class FixedWindowRateLimiter : System.Threading.RateLimiting.ReplenishingRateLimiter
type FixedWindowRateLimiter = class
inherit ReplenishingRateLimiter
Public NotInheritable Class FixedWindowRateLimiter
Inherits ReplenishingRateLimiter
- Inheritance
Constructors
FixedWindowRateLimiter(FixedWindowRateLimiterOptions) |
Initializes the FixedWindowRateLimiter. |
Properties
IdleDuration |
Specifies how long the RateLimiter has had all permits available. Used by RateLimiter managers that may want to clean up unused RateLimiters. |
IsAutoReplenishing |
Specifies if the ReplenishingRateLimiter is automatically replenishing its tokens or if it expects an external source to regularly call TryReplenish(). |
ReplenishmentPeriod |
Specifies how often the ReplenishingRateLimiter will replenish tokens.
If IsAutoReplenishing is |
Methods
AcquireAsync(Int32, CancellationToken) |
Wait until the requested permits are available or permits can no longer be acquired. (Inherited from RateLimiter) |
AcquireAsyncCore(Int32, CancellationToken) |
Method that RateLimiter implementations implement for AcquireAsync(Int32, CancellationToken). (Inherited from RateLimiter) |
AttemptAcquire(Int32) |
Fast synchronous attempt to acquire permits. (Inherited from RateLimiter) |
AttemptAcquireCore(Int32) |
Method that RateLimiter implementations implement for AttemptAcquire(Int32). (Inherited from RateLimiter) |
Dispose() |
Disposes the RateLimiter. This completes any queued acquires with a failed lease. (Inherited from RateLimiter) |
Dispose(Boolean) |
Dispose method for implementations to write. (Inherited from RateLimiter) |
DisposeAsync() |
Disposes the RateLimiter asynchronously. (Inherited from RateLimiter) |
DisposeAsyncCore() |
DisposeAsync method for implementations to write. (Inherited from RateLimiter) |
GetStatistics() |
Gets a snapshot of the RateLimiter statistics if available. |
TryReplenish() |
Attempts to replenish request counters in the window. |