Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:5.xfromwouterj:ratelimiter/doc-improvements
Oct 16, 2020

Conversation

@wouterj
Copy link
Member

QA
Branch?5.x
Bug fix?no
New feature?yes
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

While Javier wrote documentation for this new component, we found a couple of confusing elements that might need some tweaks:

  • TheLimiter class (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.

@Nyholm
Copy link
Member

👍 forRateLimiter

@nicolas-grekasnicolas-grekas added this to the5.2 milestoneOct 14, 2020
@nicolas-grekas
Copy link
Member

(rebase needed)

@wouterjwouterjforce-pushed theratelimiter/doc-improvements branch 2 times, most recently fromb1776ee to5e3991dCompareOctober 14, 2020 18:18
Copy link
Member

@fabpotfabpot left a 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

@fabpotfabpotforce-pushed theratelimiter/doc-improvements branch from783875d tocd34f21CompareOctober 16, 2020 05:10
@fabpot
Copy link
Member

Thank you@wouterj.

@fabpotfabpot merged commitabbb3d0 intosymfony:5.xOct 16, 2020
chalasr added a commit that referenced this pull requestOct 22, 2020
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()
chalasr added a commit that referenced this pull requestOct 24, 2020
…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
symfony-splitter pushed a commit to symfony/rate-limiter that referenced this pull requestOct 24, 2020
…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
@fabpotfabpot mentioned this pull requestOct 28, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@derrabusderrabusderrabus requested changes

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

6 participants

@wouterj@Nyholm@nicolas-grekas@fabpot@derrabus@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp