8000 [RateLimiter] Rename RateLimiter to RateLimiterFactory by Nyholm · Pull Request #38675 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[RateLimiter] Rename RateLimiter to RateLimiterFactory #38675

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

Merged
merged 1 commit into from
Oct 24, 2020

Conversation

Nyholm
Copy link
Member
@Nyholm Nyholm commented Oct 22, 2020
Q A
Branch? 5.x
Bug fix? no
New feature? no
Deprecations? No, not released yet
Tickets
License MIT
Doc PR should be added

Sorry for making a few BC breaks.

@wouterj said 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
  • RateLimiter

I 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.

@chalasr chalasr added this to the 5.2 milestone Oct 22, 2020
@stof
Copy link
Member
stof commented Oct 22, 2020

Such renaming makes sense to me

@jderusse jderusse changed the title [RateLimiter] Rename RateLimiter to RateLimiter factory [RateLimiter] Rename RateLimiter to RateLimiterFactory Oct 22, 2020
@Nyholm Nyholm force-pushed the ratelimiter-rename-factory branch from 52b3e0d to c08202a Compare October 22, 2020 10:17
Copy link
Member
@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reviewers suggestions should probably be taken into account, but this looks good! Thanks!

@Nyholm
Copy link
Member Author
Nyholm commented Oct 22, 2020

Thank you. PR is updated.

@chalasr
Copy link
Member
chalasr commented Oct 23, 2020

@Nyholm Why did you revert the service renaming?

@Nyholm
Copy link
Member Author
Nyholm commented Oct 23, 2020

Because the tests was failing all over the place. :(

The limiter service is abstract and all our LimiterInterface services uses that abstract service. They are created with names limiter.acme. Where acme is just the thing added to exiting service. So they would be named limiter_factory.acme.

I tried searching for all references in other components and fixing the issue but I couldn't really. I can try an another search if you want.

@chalasr
Copy link
Member
chalasr commented Oct 23, 2020

Works for me as-is. Thanks for explaining :)

@chalasr chalasr force-pushed the ratelimiter-rename-factory branch from 8d120d3 to 8be261b Compare October 24, 2020 08:11
@chalasr
Copy link
Member
chalasr commented Oct 24, 2020

Thank you Tobias.

@chalasr chalasr merged commit 1c81aa7 into symfony:5.x Oct 24, 2020
@Nyholm
Copy link
Member Author
Nyholm commented Oct 24, 2020

Thank you for merging

@Nyholm Nyholm deleted the ratelimiter-rename-factory branch October 24, 2020 08:13
@fabpot fabpot mentioned this pull request Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0