示例#1
0
 /**
  * {@inheritDoc}
  */
 public function key()
 {
     if (null !== $this->current) {
         return $this->current->getId();
     }
     return null;
 }
示例#2
0
 /**
  * {@inheritDoc}
  */
 public function addMessage(MessageInterface $message)
 {
     // set global delay if not set in message
     if (null !== $this->getDelay() && null === $message->getDelay()) {
         $message->setDelay($this->getDelay());
     }
     // set global priority if not set in message
     if (null !== $this->getPriority() && null === $message->getPriority()) {
         $message->setPriority($this->getPriority());
     }
     $this->messages[] = $message;
     return $this;
 }
示例#3
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);
 }