-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Means to statically configure a common *ResourceManager for Memcached/Redis #5787
Comments
@icywolfy You are right, it's currently not possible to share such resources over different cache-storage instances without additional work on instantiating. @Ocramius @weierophinney Thought's how to solve that. It's a very common question how to do that and it would be better if it's done by default using |
@Ocramius @weierophinney ping |
@marc-mabe I don't have any clear overview on the topic right now: the entire |
@Ocramius As the caching component is designed to have one cache instance per type of items this needs additional work on adapters working with connections for example. (You don't wont to create a new connection for each type of item to cache) - The *ResourceManager's should be used to share such resources between different cache instances. The issue here is that the *Resourcemanager's itself will be new instantiated by the service factory for each defined type. |
Yes, I understand the issue, and I agree that there should be only one ResourceManager per type, but I don't have the implementation details understanding to suggest how this should be solved. |
@Ocramius can you ping the one how is good involved in service factory logic? I don't know who it is. |
That would still be me :-) Marco Pivetta On 14 August 2014 11:49, Marc Bennewitz notifications@github.com wrote:
|
This issue has been closed as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html |
Right now, using caches with the built in tools is fairly good, however, when using Redis/Memcached, -every- instance has a private ResourceManager, and thus, creates a new connection per TTL/Namespace. (Obviously defeating the intent of the ResourceManager)
ie: given the configuration:
StorageCacheAbstractServiceFactory::createServiceWithName
calls StorageFactory explictly. Thus:
Which then calls
Here is where it creates the Redis instance,
but it then calls:
Which creates a new RedisOptions/MemcachedOptions
Which implicitly uses a new ResourceManager.
Thus, there is no sharing of the connection, and every cache namespace creates a new connection.
At a loss as to how to cleanly create the RedisOptions across the application currently.
???
???
Also, at a loss as to how to cleanly implement a shared resource manager that can be defined in a configuration file.
Thoughts:
Clarification:
Would be nice to have a configuration that looked like:
And it just call the serviceLocatior to fetch the RedisResourceManager.
Which could either be a custom factory to register the resources,
Or something built in that requires specific config keys to initialize potential resources.
The text was updated successfully, but these errors were encountered: