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

How to know RateLimiter inner Quota #200

Open
baoyachi opened this issue Aug 28, 2023 · 2 comments
Open

How to know RateLimiter inner Quota #200

baoyachi opened this issue Aug 28, 2023 · 2 comments

Comments

@baoyachi
Copy link

No description provided.

@antifuchs
Copy link
Collaborator

That's a tricky question: To save space, the RateLimiter struct doesn't retain a reference to the Quota (instead, representing the quota in its Gcra elements T and Tau. If you wish to refer back to the Quota, it's probably best to hold on to the Quota that was used to create the rate limiter; if that's not an option for you, I think it might be possible to "decompile" the Gcra elements back into a quota. Is that what you're asking for?

@baoyachi
Copy link
Author

That's a tricky question: To save space, the RateLimiter struct doesn't retain a reference to the Quota (instead, representing the quota in its Gcra elements T and Tau. If you wish to refer back to the Quota, it's probably best to hold on to the Quota that was used to create the rate limiter; if that's not an option for you, I think it might be possible to "decompile" the Gcra elements back into a quota. Is that what you're asking for?

Yes,you are right.
I need it.

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

Successfully merging a pull request may close this issue.

2 participants