Ejemplo n.º 1
0
 /**
  * @param Queue $queue
  *
  * @return $this
  */
 public function addQueue(Queue $queue)
 {
     if ($this->hasQueue($queue->name())) {
         throw new \InvalidArgumentException(sprintf('Queue "%s" already defined', $queue->name()));
     }
     $this->queues[$queue->name()] = $queue;
     return $this;
 }
Ejemplo n.º 2
0
 /**
  */
 public function initialize()
 {
     if ($this->initialized) {
         return;
     }
     $this->initialized = true;
     $this->exchange->initialize();
     $this->queue->initialize();
     $this->channel->queue_bind($this->queue->name(), $this->exchange->name());
 }