/**
  * Start a worker
  */
 protected function _startWorker()
 {
     $worker = new Worker();
     $worker->logLevel = $this->logLevel;
     fwrite(STDOUT, '*** Starting scheduler worker ' . PHP_EOL);
     $worker->work($this->interval);
 }
示例#2
0
 public function testWorkerErasesItsStatsWhenShutdown()
 {
     Resque::enqueue('jobs', 'Test_Job');
     Resque::enqueue('jobs', 'Invalid_Job');
     $worker = new Worker('jobs');
     $worker->work(0);
     $worker->work(0);
     $this->assertEquals(0, $worker->getStat('processed'));
     $this->assertEquals(0, $worker->getStat('failed'));
 }
 public function manage()
 {
     $this->worker->work();
 }