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

Throttle plugin small fixes #462

Closed
wants to merge 4 commits into from

Conversation

Big-Shark
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets partially #460
License MIT

What's in this PR?

Did code more clearly

@Big-Shark Big-Shark mentioned this pull request Jun 17, 2024
->scalarNode('key')->defaultNull()->end()
->integerNode('tokens')->defaultValue(1)->end()
->floatNode('max_time')->defaultNull()->end()
->scalarNode('name')->isRequired()->info('Rate limiter configuration name from rate_limiter.yaml')->end()
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will tricky when a user configures their own service for a rate limiter factory and does not call it limiter.{name}.

in other places, we ask for a full service name for things. i think i would prefer to do the same here:

Suggested change
->scalarNode('name')->isRequired()->info('Rate limiter configuration name from rate_limiter.yaml')->end()
->scalarNode('name')->isRequired()->info('Rate limiter factory service name, e.g. limiter.http_client for a rate limiter called http_client')->end()

wdyt? if we change it here, we also need to adjust the extension class.

and now that i understand what it is, it should be called more specific limiter_name. or while we do change it to be the service, limiter_service.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dbu Symfony automatic create factory in container, I just have this config
image

I think using just "name" more understandable than whole name in container, like "limiter.http_client"

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, when one configures in framework bundle, that creates the services with this naming pattern.

the thing is that a user might configure their own service rather than use the framework configuration, e.g. when they have a custom implementation of the rate limiter. and for that i think its more consistent with the rest of the bundle to have the full service name.

Big-Shark and others added 3 commits June 17, 2024 13:57
Co-authored-by: David Buchmann <david@liip.ch>
Co-authored-by: David Buchmann <david@liip.ch>
@dbu dbu mentioned this pull request Sep 1, 2024
@dbu
Copy link
Collaborator

dbu commented Sep 1, 2024

wrapped up in #465, thanks!

@dbu dbu closed this Sep 1, 2024
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 this pull request may close these issues.

None yet

2 participants