Example #1
0
 /**
  * Reserve and return the next available job in the specified queue.
  *
  * @param string $queue Queue to fetch next available job from.
  * @return Resque_Job Instance of Resque_Job to be processed, false if none or error.
  */
 public static function reserve($queue)
 {
     return Resque_Job::reserve($queue);
 }
Example #2
0
 /**
  * Tell Redis which job we're currently working on.
  *
  * @param object $job Resque_Job instance containing the job we're working on.
  */
 public function workingOn(Resque_Job $job)
 {
     $job->worker = $this;
     $this->currentJob = $job;
     $job->updateStatus(Resque_Job_Status::STATUS_RUNNING);
     $data = json_encode(array('queue' => $job->queue, 'run_at' => strftime('%a %b %d %H:%M:%S %Z %Y'), 'payload' => $job->payload));
     Resque::redis()->set('worker:' . $job->worker, $data);
 }