Resque_Worker::job PHP Method

job() public method

Return an object describing the job this worker is currently working on.
public job ( ) : object
return object Object with details of current job.
    public function job()
    {
        $job = Resque::redis()->get('worker:' . $this);
        if (!$job) {
            return array();
        } else {
            return json_decode($job, true);
        }
    }

Usage Example

Beispiel #1
0
 public function getCurrentJob()
 {
     $job = $this->worker->job();
     if (!$job) {
         return null;
     }
     $job = new \Resque_Job($job['queue'], $job['payload']);
     return $job->getInstance();
 }
All Usage Examples Of Resque_Worker::job