示例#1
0
 /**
  * Pop the next job off of the queue.
  * @link https://help.aliyun.com/document_detail/35136.html
  *
  * @param string $queue
  *
  * @return \Illuminate\Queue\Jobs\Job|null
  */
 public function pop($queue = null)
 {
     $queue = $this->getDefaultIfNull($queue);
     try {
         $response = $this->adapter->useQueue($this->getQueue($queue))->receiveMessage($this->waitSeconds);
     } catch (MessageNotExistException $e) {
         $response = null;
     }
     if ($response) {
         return new Jobs\MNSJob($this->container, $this->adapter, $queue, $response);
     }
     return null;
 }