Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function get($name)
 {
     $config = new SqsQueueConfig();
     $config->setName($this->prepareQueueName($name));
     if ($this->has($name)) {
         $attributes = $this->readQueueAttributes($config->getName());
         $config->hydrate($attributes);
         return new SqsQueue($this->client, $config);
     } else {
         if (!$this->config->getCreateNotFound()) {
             throw new QueueNotFoundException('cannot find the queue with name ' . $name);
         }
         $config->setName($name);
         return $this->create($config);
     }
 }
Ejemplo n.º 2
0
 /**
  * If no delay is set in the message, we fallback to the queue config message delay
  *
  * @param MessageInterface $message
  * @return int|mixed
  */
 protected function getMessageDelay(MessageInterface $message)
 {
     $delay = $message->getDelay() === null ? $this->config->getDelaySeconds() : $message->getDelay();
     return min($delay, SqsQueueConfig::MAX_DELAY_SECONDS);
 }