/** * 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; } } }
/** * 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); }
/** * 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)); }
/** * 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); }
/** * 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; }
/** * 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); }
/** * 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); }