I have to integrate Gearman in a zf2 project. I have made some search and I
found a zf2 module for this (https://github.com/mwillbanks/MwGearman). Did
anybody used this module?
I have some problem with it.
The problem is that I want to use it in a controller and this is how you
register a worker function:
This would work with scripts but not with classes because I have to
transmit $this too. I have locked into the code of the module and I have
found out that I can use an array($this,'function') instead of 'handleJob'
but this does not work because Gearman worker register function does accept
only string as you can see in the documentation:
Can anybody help me? How can I use this module in a controller?
Some parts are working. For example I can use the service manager. But I
need to create links from routes too and that does not work.
Should I set up the router in GearmanManager separatly. I think this should
be done by zf2 as it does when I request a page from a browser.
Do you have any idea how could I load the whole zf2 in a gearman worker?
> On Friday, July 12, 2013 at 9:37 AM, Norbert Máté wrote:
> > Hi,
> > I have to integrate Gearman in a zf2 project. I have made some search
> and I
> > found a zf2 module for this (https://github.com/mwillbanks/MwGearman).
> > anybody used this module?
> > I have some problem with it.
> > The problem is that I want to use it in a controller and this is how you
> > register a worker function:
> > $gearman->register('myJob', 'handleJob');
> I would always use addFunction():
> http://www.php.net/manual/en/gearmanworker.addfunction.php >
> The GearmanManager is the best project I have come across in the past
> years. Give it a try:
> https://github.com/brianlmoon/GearmanManager >