コード例 #1
0
 /**
  * @param string $protocol
  * @param string $encoding
  * @param bool   $synchronous
  * @param array  $endpoint
  */
 public function __construct($protocol, $encoding, array $endpoint = [], $synchronous = false)
 {
     parent::__construct($protocol, $encoding, $synchronous, $endpoint);
     list($broker, $username, $password, $headers, $destination) = array_values($this->endpoint);
     $this->client = new \Stomp($broker, $username, $password, $headers);
     $this->destination = $destination;
 }
コード例 #2
0
 /**
  * @param string $protocol
  * @param string $encoding
  * @param bool   $synchronous
  * @param array  $endpoint
  */
 public function __construct($protocol, $encoding, $synchronous = false, array $endpoint = [])
 {
     parent::__construct($protocol, $encoding, $synchronous, $endpoint);
     list($type, $dsn, $force, $mode) = array_values($this->endpoint);
     $this->context = new \ZMQContext();
     $this->socket = new \ZMQSocket($this->context, $type);
     $this->socket->bind($dsn, $force);
     $this->mode = $mode;
 }
コード例 #3
0
 /**
  * @param string $protocol
  * @param string $encoding
  * @param bool   $synchronous
  * @param array  $endpoint
  */
 public function __construct($protocol, $encoding, $synchronous = false, array $endpoint = [])
 {
     parent::__construct($protocol, $encoding, $synchronous, $endpoint);
     list($exchangeName, $routingKey) = array_values($this->endpoint);
     $credentials = array_filter($this->endpoint);
     $this->connection = new \AMQPConnection($credentials);
     $this->connection->connect();
     $this->channel = new \AMQPChannel($this->connection);
     $this->exchange = new \AMQPExchange($this->channel);
     $this->exchange->setName($exchangeName);
 }