Skip to content
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

Feature: attr_reader for LeakyBucket config options #6259

Closed
stevenou opened this issue Apr 19, 2024 · 1 comment
Closed

Feature: attr_reader for LeakyBucket config options #6259

stevenou opened this issue Apr 19, 2024 · 1 comment

Comments

@stevenou
Copy link

Sidekiq::Limiter::Window has attr_reader :interval, :count, :bucket and Sidekiq::Limiter::Bucket has attr_reader :interval, :count.

I propose adding attr_reader for the configuration options to the limiters that don't have it. I could specifically use it on Sidekiq::Limiter::LeakyBucket, which doesn't have any attribute readers. It would be nice to expose the size and interval.

My use case is that I'm reading the limiter when hitting OverLimit error and using the limiter config details to calculate an optimal backoff time (see discussion in #6141)

@mperham
Copy link
Collaborator

mperham commented Apr 19, 2024

Thanks for the suggestion, it’s a good idea. 👍🏻

@mperham mperham closed this as completed Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants