Example #1
0
 /**
  * Constructor
  *
  * @param SqsClient        $sqsClient
  * @param SqsQueueOptions  $options
  * @param string           $name
  * @param JobPluginManager $jobPluginManager
  */
 public function __construct(SqsClient $sqsClient, SqsQueueOptions $options, $name, JobPluginManager $jobPluginManager)
 {
     $this->sqsClient = $sqsClient;
     $this->queueOptions = $options;
     parent::__construct($name, $jobPluginManager);
     // If an URL has explicitly been given in the options, let's use it, otherwise we dynamically fetch it
     if (!$this->queueOptions->getQueueUrl()) {
         $queue = $this->sqsClient->getQueueUrl(array('QueueName' => $name));
         $this->queueOptions->setQueueUrl($queue['QueueUrl']);
     }
 }