Closed basz closed 6 years ago
don't think so.. PR https://github.com/juriansluiman/SlmQueue/pull/201 affects only users who does not use zend-mvc and anyway they can still get eventmanager with this https://github.com/juriansluiman/SlmQueue/blob/master/src/Worker/AbstractWorker.php#L79 it is not a shared event manager but it is eventmanager anyway...
so adding something like
or you should attach listeners to the manager from your Worker::getEventManager()
would be more accurate?
or should we remove this doc at all and suggest Worker::getEventManager
? https://github.com/basz/SlmQueue/blob/93d194af791b22ea8864dfc3f9665bfca02d9661/docs/6.Events.md#using-the-shared-event-manager
I think both are valid not sure with one is more accurate. but I would go with Worker::getEventManager since this is valid both ways.
@basz I didn't now we have this in docs but I guess this does not change anything since this example is for zend-mvc and still working. But I guess to be more clear and safe we could get not shared event manager but event manager from worker because who knows how it is created maybe someone is using different factory and this way using custom event manager... so using event manager from worker always will be safe..
I think that in next version maybe we could get ride of shared event manager at all? also not sure if this is important but with zend-mvc Worker::getEventManager will return SharedEventManager but without it will return just EventManager. Is this important and should return the same in both cases?
oh I was wrong.. Both has EventManager the difference is that EventManager from zend-mvc is created with attached shared event manager I guess this is the only difference. But anyway if event will be attached to event manager from Worker:getEventManager then there is no big difference if we will not use SharedEventManager and remove from docs or update docs to use event manager from Worker::getEventManager.
I think that in next version maybe we could get ride of shared event manager at all
me too
if event manager is important in this module maybe would be good idea to introduce container key for eventmanager would be easier to add it.
@basz And went ahead and merged the changes in master. Thanks!
@svycka Does this make sense?