Esempio n. 1
0
 public function __construct($connection, $queue_name = null, $prefetchCount = null, $args = null)
 {
     parent::__construct($connection, $prefetchCount);
     $this->queue = new \AMQPQueue($this->channel);
     if (!empty($queue_name)) {
         $this->queue->setName($queue_name);
     } else {
         // declare new queue
         $this->queue->setFlags(AMQP_EXCLUSIVE | AMQP_AUTODELETE);
         $this->queue->declare();
     }
     if (is_array($args)) {
         $this->queue->setArguments($args);
     }
 }
Esempio n. 2
0
 /**
  * Create a new channel instance.
  *
  * @param  string  $name
  * @return void
  */
 public function __construct($name)
 {
     parent::__construct('private-' . $name);
 }
 /**
  * Create a new channel instance.
  *
  * @param  string  $name
  * @return void
  */
 public function __construct($name)
 {
     parent::__construct('presence-' . $name);
 }
Esempio n. 4
0
 /**
  * @param Kafka $connection
  */
 public function __construct(Kafka $connection)
 {
     parent::__construct($connection);
     $this->messageQueue = array();
 }
Esempio n. 5
0
 public function __construct($socket, $timeout)
 {
     parent::__construct(uniqid(), null, $socket, $timeout);
     $this->fresh = true;
 }
Esempio n. 6
0
 public function __construct($connection, $exchange_name)
 {
     parent::__construct($connection);
     $this->exchange = new \AMQPExchange($this->channel);
     $this->exchange->setName($exchange_name);
 }