API Reference
Class
AsyncIntervalGate
Provides a simple async gate that ensures callers do not proceed more often than a configured interval.
Inheritance
- Object
- AsyncIntervalGate
Remarks
This is useful for rate limiting DNS queries across concurrent tasks.
Constructors
public AsyncIntervalGate(TimeSpan interval) #Initializes a new instance of the AsyncIntervalGate class.
Parameters
- interval System.TimeSpan
- Minimum interval between permits; negative values are treated as zero.
Methods
public async Task WaitAsync(CancellationToken cancellationToken = null) #Returns:
TaskWaits until the next permit is available and then consumes it.
Parameters
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the wait.