-
-
Save lgolubyev/9a2c09076f5c1e5c17a8e249c87eb674 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class RateLimiter : IAsyncDisposable, IDisposable | |
{ | |
public abstract int GetAvailablePermits(); | |
public abstract TimeSpan? IdleDuration { get; } | |
public RateLimitLease Acquire(int permitCount = 1); | |
public ValueTask<RateLimitLease> WaitAsync(int permitCount = 1, CancellationToken cancellationToken = default); | |
public void Dispose(); | |
public ValueTask DisposeAsync(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment