当前位置: 首页>>代码示例>>PHP>>正文


PHP AMQPConnection::get_free_channel_id方法代码示例

本文整理汇总了PHP中PhpAmqpLib\Connection\AMQPConnection::get_free_channel_id方法的典型用法代码示例。如果您正苦于以下问题:PHP AMQPConnection::get_free_channel_id方法的具体用法?PHP AMQPConnection::get_free_channel_id怎么用?PHP AMQPConnection::get_free_channel_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhpAmqpLib\Connection\AMQPConnection的用法示例。


在下文中一共展示了AMQPConnection::get_free_channel_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Class constructor
  *
  * @param Container $container
  * @param Configuration $configuration
  * @param Channel|null $channel
  */
 public function __construct(Container $container, Configuration $configuration, Channel $channel = null)
 {
     $this->container = $container;
     $this->configuration = $configuration;
     // Create a new instance of the AMQPConnection object
     /** @var \PhpAmqpLib\Connection\AMQPConnection $conn */
     $conn = $container->newInstance('PhpAmqpLib\\Connection\\AMQPConnection', array($configuration->getHost(), $configuration->getPort(), $configuration->getUser(), $configuration->getPass()));
     // Override the default library properties
     $conn::$LIBRARY_PROPERTIES = array('library' => array('S', 'Mopsy PHP Client'), 'library_version' => array('S', '0.1'));
     $this->connection = $conn;
     if ($channel === null) {
         //$this->channel = $this->connection->channel();
         $this->channel = $container->newInstance('Mopsy\\Channel', array($this, $this->connection->get_free_channel_id(), true));
     } else {
         $this->channel = $channel;
     }
     $this->channels[$this->channel->getChannelId()] = $this->channel;
     $this->connection->channels[$this->channel->getChannelId()] = $this->channel;
     /** @var Channel\Options queueOptions */
     $this->exchangeOptions = $container->newInstance('Mopsy\\Channel\\Options');
     /** @var Channel\Options queueOptions */
     $this->queueOptions = $container->newInstance('Mopsy\\Channel\\Options');
     /*
      * Queues will expire after 30 minutes of being unused, meaning it has
      * no consumers, has not been redeclared, and basic.get has not been
      * invoked.
      *
      * Messages will be discard from this queue if they haven't been
      * acknowledged after 60 seconds.
      */
     $this->queueOptions->setArguments(array('x-message-ttl', 60000, 'x-expires' => 1800000));
 }
开发者ID:ebeyrent,项目名称:mopsy,代码行数:39,代码来源:Connection.php


注:本文中的PhpAmqpLib\Connection\AMQPConnection::get_free_channel_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。