Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[RateLimiter] Adding SlidingWindow algorithm#38565
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
wouterj commentedOct 14, 2020
👍 I like this. Thanks! |
wouterj left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Apart from my comments, this looks good to me.
@fabpot would be cool to also have this in 5.2, though it's not 100% needed. Sliding windows generally is better than fixed windows, as they flatten bursts much better.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| } | ||
| } | ||
| private function getAvailableTokens(int $hitCount): int |
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.
This method is public inFixedWindow,
@wouterj is that a bug? It is not part of the interface and never used outside of the class.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedOct 15, 2020
Thank you@Nyholm. |
Nyholm commentedOct 15, 2020
Thank you for merging |
This is a draft PR to make sure we like the idea. I'll keep working on adding tests.