Beispiel #1
0
 /**
  * Find the next available job from the specified queue and return an
  * instance of Resque_Job for it.
  *
  * @param string $queue The name of the queue to check for a job in.
  * @return null|Job Null when there aren't any waiting jobs, instance of Resque_Job when a job was found.
  */
 public static function reserve($queue)
 {
     $payload = Resque::pop($queue);
     if (!is_array($payload)) {
         return false;
     }
     return new Job($queue, $payload);
 }