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] Added reserve() to LimiterInterface and rename Limiter to RateLimiter#38562
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
Uh oh!
There was an error while loading.Please reload this page.
Nyholm commentedOct 14, 2020
👍 for |
nicolas-grekas commentedOct 14, 2020
(rebase needed) |
b1776ee to5e3991dCompare
fabpot 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.
Ready IMHO when the TODO is resolved
src/Symfony/Component/RateLimiter/Exception/MaxWaitDurationExceededException.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
87a3ec8 to783875dCompare783875d tocd34f21Comparefabpot commentedOct 16, 2020
Thank you@wouterj. |
This PR was merged into the 5.x branch.Discussion----------[RateLimiter] Remove Window::sleep()| Q | A| ------------- | ---| Branch? | 5.x| Bug fix? | no| New feature? | no| Deprecations? || Tickets || License | MIT| Doc PR |This function is not needed since#38562Commits-------ccbf7d5 [RateLimiter] Remove Window::sleep()
…holm)This PR was squashed before being merged into the 5.x branch.Discussion----------[RateLimiter] Rename RateLimiter to RateLimiterFactory| Q | A| ------------- | ---| Branch? | 5.x| Bug fix? | no| New feature? | no| Deprecations? | No, not released yet| Tickets || License | MIT| Doc PR | should be addedSorry for making a few BC breaks.@wouterj [said](#38562 (comment)) that this class was suggested to be named `LimiterFactory` before. But that was rejected.Just my looking at the names of the classes we currently have:- Rate- RateLimit- RateLimiterI find it hard to know what these are doing and the difference between them. Note that none of them are used as a rate limiter (ie implements `LimiterInterface`)I would like to be clear that a `RateLimiterFactory` is used to create an object implementing `LimiterInterface`.Commits-------8be261b [RateLimiter] Rename RateLimiter to RateLimiterFactory
…holm)This PR was squashed before being merged into the 5.x branch.Discussion----------[RateLimiter] Rename RateLimiter to RateLimiterFactory| Q | A| ------------- | ---| Branch? | 5.x| Bug fix? | no| New feature? | no| Deprecations? | No, not released yet| Tickets || License | MIT| Doc PR | should be addedSorry for making a few BC breaks.@wouterj [said](symfony/symfony#38562 (comment)) that this class was suggested to be named `LimiterFactory` before. But that was rejected.Just my looking at the names of the classes we currently have:- Rate- RateLimit- RateLimiterI find it hard to know what these are doing and the difference between them. Note that none of them are used as a rate limiter (ie implements `LimiterInterface`)I would like to be clear that a `RateLimiterFactory` is used to create an object implementing `LimiterInterface`.Commits-------8be261b300 [RateLimiter] Rename RateLimiter to RateLimiterFactory
While Javier wrote documentation for this new component, we found a couple of confusing elements that might need some tweaks:
Limiterclass (previously calledLimiterFactory) has imho a bit strange name, as it's not a limiter and it doesn't implementLimiterInterface. It can only new limiters. I believeLimiterFactory- likeLockFactory- would be the most clear, but as that was rejected before, here is another proposal usingRateLimiter.reserve()was now only part of the token bucket implementation. That made it a bit less useful. I think I've found a way to also allow reserving future hits in the fixed window implementation, so I've moved it to theLimiterInterface.