Beispiel #1
0
 /**
  * Release the job back into the queue.
  *
  * @param int $delay
  */
 public function release($delay = 1)
 {
     parent::release($delay);
     if ($delay < 1) {
         $delay = 1;
     }
     $this->adapter->changeMessageVisibility($this->job->getReceiptHandle(), $delay);
 }
Beispiel #2
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;
 }