Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle][RateLimiter] add rate_limiter tag to rate limiter services #53091

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
Dec 19, 2023

Conversation

kbond
Copy link
Member

@kbond kbond commented Dec 15, 2023

Q A
Branch? 7.1
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #52516
License MIT

This will allow creating tagged iterators/locators containing all registered rate limiters (indexed by their name).

@carsonbot carsonbot added this to the 7.1 milestone Dec 15, 2023
@carsonbot carsonbot changed the title [RateLimiter][FrameworkBundle] add rate_limiter tag to rate limiter services [FrameworkBundle][RateLimiter] add rate_limiter tag to rate limiter services Dec 15, 2023
@@ -2860,7 +2860,8 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde
// default configuration (when used by other DI extensions)
$limiterConfig += ['lock_factory' => 'lock.factory', 'cache_pool' => 'cache.rate_limiter'];

$limiter = $container->setDefinition($limiterId = 'limiter.'.$name, new ChildDefinition('limiter'));
$limiter = $container->setDefinition($limiterId = 'limiter.'.$name, new ChildDefinition('limiter'))
->addTag('rate_limiter', ['name' => $name]);
Copy link
Member Author

Choose a reason for hiding this comment

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

I think name is the standard tag index we use now or am I mistaken?

@fabpot
Copy link
Member

fabpot commented Dec 19, 2023

Thank you @kbond.

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.

[RateLimiter][FrameworkBundle] add a tag to configured rate limiters
4 participants