示例#1
0
 /**
  * Get the next job from the queue connection.
  *
  * @param  \Illuminate\Queue\Queue  $connection
  * @param  string  $queue
  * @return \Illuminate\Queue\Jobs\Job|null
  */
 protected function getNextJob($connection, $queue)
 {
     if (is_null($queue)) {
         return $connection->pop();
     }
     foreach (explode(',', $queue) as $queue) {
         if (!is_null($job = $connection->pop($queue))) {
             return $job;
         }
     }
 }
示例#2
0
 /**
  * Create a payload string from the given job and data.
  *
  * @param  string  $job
  * @param  mixed   $data
  * @param  string  $queue
  * @return string
  */
 protected function createPayload($job, $data = '', $queue = null)
 {
     $payload = parent::createPayload($job, $data);
     $payload = $this->setMeta($payload, 'id', $this->getRandomId());
     return $this->setMeta($payload, 'attempts', 1);
 }
示例#3
0
 /**
  * Create a payload string from the given job and data.
  *
  * @param  string  $job
  * @param  mixed   $data
  * @param  string  $queue
  * @return string
  */
 protected function createPayload($job, $data = '', $queue = null)
 {
     $payload = $this->setMeta(parent::createPayload($job, $data), 'attempts', 1);
     return $this->setMeta($payload, 'queue', $this->getQueue($queue));
 }
示例#4
0
 /**
  * Overwrite the queue method to push to a different queue.
  *
  * @param Queue $queue
  * @param Job $command
  */
 public function queue(Queue $queue, $command)
 {
     $queue->pushOn('deployer-high', $command);
 }
示例#5
0
 /**
  * Create a payload string from the given job and data.
  *
  * @param  string  $job
  * @param  mixed   $data
  * @return string
  */
 protected function createPayload($job, $data = '')
 {
     return $this->crypt->encrypt(parent::createPayload($job, $data));
 }
 /**
  * Push a new job onto the queue.
  *
  * @param  string $job
  * @param  mixed $data
  * @param  string $queue
  * @return int
  */
 public function push($job, $data = '', $queue = null)
 {
     $payload = parent::createPayload($job, $data);
     $jobIndentifier = $this->pushRaw($payload, null, $this->options);
     return $jobIndentifier;
 }
示例#7
0
 /**
  * Create a payload string from the given job and data.
  *
  * @param  string  $job
  * @param  mixed   $data
  * @param  string  $queue
  * @return string
  */
 protected function createPayload($job, $data = '', $queue = null)
 {
     return parent::createPayload($job, $data);
 }
示例#8
0
 /**
  * Overwrite the queue method to push to a different queue.
  *
  * @param  Queue $queue
  * @param  Job   $command
  * @return void
  */
 public function queue(Queue $queue, $command)
 {
     $queue->pushOn('low', $command);
 }