Resque\Job::setWorker PHP Метод

setWorker() публичный Метод

Set the queue worker interface
public setWorker ( Worker $worker )
$worker Worker
    public function setWorker(Worker $worker)
    {
        $this->worker = $worker;
    }

Usage Example

Пример #1
0
 /**
  * Tell Redis which job we're currently working on.
  *
  * @param Job $job Job instance containing the job we're working on.
  */
 public function workingOn(Job &$job)
 {
     $this->job = $job;
     $job->setWorker($this);
     Event::fire(Event::WORKER_WORKING_ON, array($this, $job));
     $this->redis->hmset(self::redisKey($this), array('job_id' => $job->getId(), 'job_started' => microtime(true)));
 }