-
Notifications
You must be signed in to change notification settings - Fork 347
TokenBucketRateLimiter implementation #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| /// <summary> | ||
| /// <see cref="RateLimiter"/> implementation that replenishes tokens periodically instead of via a release mechanism. | ||
| /// </summary> | ||
| public sealed class TokenBucketRateLimiter : RateLimiter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be disposable because of the _renewTimer? Even if AutoReplenishment is disabled, we probably would want to cancel all queued acquisition request because I doubt anyone will be calling TryReplenish() after disposal and we'll want to cancel all the Tasks and dispose all the CancellationTokenRegistrations.
a87be3c to
13b92c0
Compare
halter73
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's file an issue for making rate limiters disposable.
Depends on #387 so there aren't two PRs adding the test infra/csproj properties.