Example #1
0
 /**
  * Returns a ManagerInterface
  *
  * @param integer $timeout Wait timeout for pop
  *
  * @return ManagerInterface Returns null if $manager is not a valid ManagerIterface
  */
 protected function getManager($timeout = 0)
 {
     try {
         $manager = $this->connector->pop($this->queue, $timeout);
     } catch (JobNotFoundException $e) {
         $this->connector->delete($manager);
         return false;
     } catch (QueueEmptyException $e) {
         return false;
     }
     if ($manager instanceof LoggerAwareInterface) {
         $manager->setLogger($this->logger);
     }
     return $manager;
 }
Example #2
0
 /**
  * Tries to delete the job
  *
  * @return boolean
  *
  * @codeCoverageIgnore
  */
 protected function autoDelete()
 {
     return $this->config['delete'] === true and $this->connector->delete($this);
 }
Example #3
0
 /**
  * Pushes a new job onto the queue after a delay
  *
  * @param integer $delay
  * @param Job     $job
  *
  * @return mixed
  */
 public function delayed($delay, Job $job)
 {
     return $this->connector->delayed($this->queue, $delay, $job);
 }