Example #1
0
 /**
  * Get the next job on this queue.
  *
  * @param     $worker - worker name popping the job.
  * @param int $numJobs - number of jobs to pop off of the queue
  *
  * @return Job[]
  */
 public function pop($worker, $numJobs = 1)
 {
     $results = $this->client->pop($this->name, $worker, $numJobs);
     $jobs = json_decode($results, true);
     $returnJobs = [];
     if (!empty($jobs)) {
         foreach ($jobs as $job_data) {
             $returnJobs[] = new Job($this->client, $job_data);
         }
     }
     return $returnJobs;
 }