Beispiel #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);
     }
 }
Beispiel #2
0
 /**
  * @param SqsClient $client
  * @param array|\Qu\Adapter\Sqs\SqsQueueConfig $config
  */
 public function __construct(SqsClient $client, SqsQueueConfig $config)
 {
     $this->client = $client;
     $this->config = $config;
     $this->url = $client->getBaseUrl() . '/' . $this->config->getAccountId() . '/' . $this->config->getName();
 }