System.Threading.RateLimiting.RateLimiter
Represents a limiter type that users interact with to determine if an operation can proceed.
Specifies how long the RateLimiter has had all permits available. Used by RateLimiter managers that may want to
clean up unused RateLimiters.
protected RateLimiter()
Creates a single RateLimiter that wraps the passed in RateLimiters.
public ValueTask<RateLimitLease> AcquireAsync(int permitCount = 1, CancellationToken cancellationToken = default)
Wait until the requested permits are available or permits can no longer be acquired.
protected abstract ValueTask<RateLimitLease> AcquireAsyncCore(int permitCount, CancellationToken cancellationToken)
Method that RateLimiter implementations implement for AcquireAsync.
Fast synchronous attempt to acquire permits.
Method that RateLimiter implementations implement for AttemptAcquire.
Dispose method for implementations to write.
Disposes the RateLimiter. This completes any queued acquires with a failed lease.
Disposes the RateLimiter asynchronously.
DisposeAsync method for implementations to write.
Gets a snapshot of the RateLimiter statistics if available.