/** * Release the job back into the queue. * * @param int $delay * * @return void */ public function release($delay = 0) { $release = new \DateTime(); $release->setTimezone(new \DateTimeZone('UTC')); $release->add(new \DateInterval('PT' . $delay . 'S')); $this->job->setScheduledEnqueueTimeUtc($release); $this->azure->unlockMessage($this->job); }
/** * Pop the next job off of the queue. * * @param string $queue * * @return \Illuminate\Queue\Jobs\Job|null */ public function pop($queue = null) { $queue = $this->getQueue($queue); $options = new ReceiveMessageOptions(); $options->setPeekLock(); $job = $this->azure->receiveQueueMessage($queue, $options); if (!is_null($job)) { return new AzureJob($this->container, $this->azure, $job, $queue); } }