Exemplo n.º 1
0
 public function testWorkerFailsUncompletedJobsOnExit()
 {
     $worker = new Worker('jobs');
     $worker->registerWorker();
     $payload = array('class' => TestJob::className());
     $job = new Job('jobs', $payload);
     $worker->workingOn($job);
     $worker->unregisterWorker();
     $this->assertEquals(1, Stat::get('failed'));
 }
Exemplo n.º 2
0
 /**
  * Start a worker
  */
 protected function _startWorker()
 {
     $worker = new Worker($this->queues);
     $worker->logLevel = $this->logLevel;
     fwrite(STDOUT, '*** Starting worker ' . $worker . PHP_EOL);
     $worker->work($this->interval);
 }