mwillbanks / MwGearman

Gearman Module for ZF2
20 stars 7 forks source link

getting exception when trying to run worker #5

Open tatanasova opened 10 years ago

tatanasova commented 10 years ago

Following your example for worker:

$serviceMananger = $this->getServiceLocator();
$gearmanW = $serviceMananger->get('mwGearman\Worker\Pecl'); $gearmanW->register('myJob8', array('Listuploads\Model\SubscribeJob','execute')); $gearmanW->connect();

while($gearmanW->work());

when I run worker this is what I get:

PHP Warning: Illegal offset type in isset or empty in /Library/WebServer/Documents/subcenter/vendor/mwillbanks/mw-gearman/src/mwGearman/Worker/Pecl.php on line 174 PHP Warning: Illegal offset type in /Library/WebServer/Documents/subcenter/vendor/mwillbanks/mw-gearman/src/mwGearman/Worker/Pecl.php on line 175 PHP Fatal error: Call to a member function addServers() on a non-object in /Library/WebServer/Documents/subcenter/vendor/mwillbanks/mw-gearman/src/mwGearman/Worker/Pecl.php on line 119

Just for clarification, using directly the pecl gearman functions works ok.

What am I doing wrong? Thank you for your time and for writing this :)