Beispiel #1
0
 /**
  * Find the next available job from the specified queues using blocking list pop
  * and return an instance of Job for it.
  *
  * @param array             $queues
  * @param int               $timeout
  * @return null|object Null when there aren't any waiting jobs, instance of Job when a job was found.
  */
 public static function reserveBlocking(array $queues, $timeout = null)
 {
     $item = Resque::blpop($queues, $timeout);
     if (!is_array($item)) {
         return false;
     }
     return new Job($item['queue'], $item['payload']);
 }