Пример #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);
     }
 }
Пример #2
0
 /**
  * Create a new channel instance.
  *
  * @param  string  $name
  * @return void
  */
 public function __construct($name)
 {
     parent::__construct('private-' . $name);
 }
Пример #3
0
 /**
  * Create a new channel instance.
  *
  * @param  string  $name
  * @return void
  */
 public function __construct($name)
 {
     parent::__construct('presence-' . $name);
 }
Пример #4
0
 /**
  * @param Kafka $connection
  */
 public function __construct(Kafka $connection)
 {
     parent::__construct($connection);
     $this->messageQueue = array();
 }
Пример #5
0
 public function __construct($socket, $timeout)
 {
     parent::__construct(uniqid(), null, $socket, $timeout);
     $this->fresh = true;
 }
Пример #6
0
 public function __construct($connection, $exchange_name)
 {
     parent::__construct($connection);
     $this->exchange = new \AMQPExchange($this->channel);
     $this->exchange->setName($exchange_name);
 }