-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Make AbstractTrait::getId and $namespace protected. #23960
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
Conversation
Well, this method is not a supported extension point currently. I'm not sure we want to make it a supported inheritance extension point for people extending our cache implementations |
and anyway, doing it in 3.3 is a no-go. Adding new inheritance-based extension point is considered a new feature. |
I agree with @stof |
$namespace is also private and there is no setter. |
I can achieve the same result by extending all the protected methods and changing the id there, but since there is already getId-method that seems a bit bulky. |
So, you need instant clearing? Did you measure it as slow on your use case? By how much? |
I want to clear a namespaced memcached instance and I expect all other memcached instances not to be cleared afterwards. |
OK, got it. I suggest considering the issue as a bug, and implementing this strategy in the existing MemcachedTrait: when a non empty namespace is used, we do versioning. The extra round trip is the only way to solve the issue anyway. |
Thank you for raising the point @hcomnetworkers |
…pport clearing by keys (nicolas-grekas) This PR was merged into the 3.3 branch. Discussion ---------- [Cache] Use namespace versioning for backends that dont support clearing by keys | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #23960 | License | MIT | Doc PR | - Commits ------- f8a7518 [Cache] Use namespace versioning for backends that dont support clearing by keys
This PR allows to extend the getId-method of the caching classes.
Use case: Incrementing the namespace upon a clear()-call instead of flushing all cache instances with all namespaces (e.g. with Memcached).