Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
RateLimiter Class
Definition
- Namespace:
- System.Threading.RateLimiting
- Assembly:
- System.Threading.RateLimiting.dll
- Package:
- System.Threading.RateLimiting v11.0.0-preview.5.26302.115
- Source:
- RateLimiter.cs
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.
Represents a limiter type that users interact with to determine if an operation can proceed.
public ref class RateLimiter abstract : IAsyncDisposable, IDisposable
public abstract class RateLimiter : IAsyncDisposable, IDisposable
type RateLimiter = class
interface IAsyncDisposable
interface IDisposable
Public MustInherit Class RateLimiter
Implements IAsyncDisposable, IDisposable
- Inheritance
-
RateLimiter
- Derived
- Implements
Constructors
| Name | Description |
|---|---|
| RateLimiter() | |
Properties
| Name | Description |
|---|---|
| IdleDuration |
Specifies how long the RateLimiter has had all permits available. Used by RateLimiter managers that may want to clean up unused RateLimiters. |
Methods
| Name | Description |
|---|---|
| AcquireAsync(Int32, CancellationToken) |
Wait until the requested permits are available or permits can no longer be acquired. |
| AcquireAsyncCore(Int32, CancellationToken) |
Method that RateLimiter implementations implement for AcquireAsync(Int32, CancellationToken). |
| AttemptAcquire(Int32) |
Fast synchronous attempt to acquire permits. |
| AttemptAcquireCore(Int32) |
Method that RateLimiter implementations implement for AttemptAcquire(Int32). |
| CreateChained(RateLimiter[]) |
Creates a single RateLimiter that wraps the passed in RateLimiters. |
| Dispose() |
Disposes the RateLimiter. This completes any queued acquires with a failed lease. |
| Dispose(Boolean) |
Dispose method for implementations to write. |
| DisposeAsync() |
Disposes the RateLimiter asynchronously. |
| DisposeAsyncCore() |
DisposeAsync method for implementations to write. |
| GetStatistics() |
Gets a snapshot of the RateLimiter statistics if available. |
Extension Methods
| Name | Description |
|---|---|
| ConfigureAwait(IAsyncDisposable, Boolean) |
Configures how awaits on the tasks returned from an async disposable will be performed. |
Applies to
Feedback
Was this page helpful?
