AMQP,即Advanced Message Queuing Protocol,一个提供统一消息服务的应用层标准高级消息队列协议,是应用层协议的一个开放标准,为面向消息的中间件设计。基于此协议的客户端与消息中间件可传递消息,并不受客户端/中间件不同产品,不同的开发语言等条件的限制。Erlang中的实现有 RabbitMQ等。
abstract class AbstractChannel { const PROTOCOL_080 = '0.8'; const PROTOCOL_091 = '0.9.1'; public static $PROTOCOL_CONSTANTS_CLASS; public function __construct(AbstractConnection $connection, $channel_id) { $this->connection = $connection; $this->channel_id = $channel_id; $connection->channels[$channel_id] = $this; $this->frame_queue = array(); // Lower level queue for frames $this->method_queue = array(); // Higher level queue for methods $this->auto_decode = false; $this->msg_property_reader = new AMQPReader(null); $this->wait_content_reader = new AMQPReader(null); $this->dispatch_reader = new AMQPReader(null); $this->protocolVersion = self::getProtocolVersion(); switch ($this->protocolVersion) { case self::PROTOCOL_091: self::$PROTOCOL_CONSTANTS_CLASS = 'PhpAmqpLib\Wire\Constants091'; $c = self::$PROTOCOL_CONSTANTS_CLASS; $this->debug = new DebugHelper($c); $this->amqp_protocol_header = $c::$AMQP_PROTOCOL_HEADER; $this->protocolWriter = new Protocol091(); $this->waitHelper = new Wait091(); $this->methodMap = new MethodMap091(); break; case self::PROTOCOL_080: self::$PROTOCOL_CONSTANTS_CLASS = 'PhpAmqpLib\Wire\Constants080'; $c = self::$PROTOCOL_CONSTANTS_CLASS; $this->debug = new DebugHelper($c); $this->amqp_protocol_header = $c::$AMQP_PROTOCOL_HEADER; $this->protocolWriter = new Protocol080(); $this->waitHelper = new Wait080(); $this->methodMap = new MethodMap080(); break; default: throw new AMQPRuntimeException(sprintf( 'Protocol: %s not implemented.', $this->protocolVersion )); } }
本站所有资源均由网友贡献或各大下载网站转载。请自行检查软件的完整性!本站所有资源仅供学习参考。请不要将它们用于商业目的。否则,一切后果由您负责!如有侵权,请联系我们删除。联系方式:admin@php.cn
相关文章

28 Dec 2024
PHP 库很方便,因为可以从应用程序中的任何位置访问它们:从插件、组件模型、模块等。如果有人已经解决了类似的问题并将其设计为库(甚至更新了它),那就有意义了

17 Feb 2025
WordPress 深度依赖第三方 JavaScript 和 PHP 库,其中 jQuery 是使用最广泛的 JavaScript 库,PHP 库主要由单个类文件组成。其他使用的 JavaScript 库包括 jQuery Masonry、jQuery Hotkeys、jQuery Suggest、jQuery Form、jQuery Color、jQuery Migrate、jQuery Schedule、jQuery UI、Backbone、colorpicker、hoverIntent、S

06 Apr 2023
PHP作为一种流行的服务器端脚本语言,可以汇集许多不同的数据类型和数据库。尤其是在web应用程序的开发中,它经常需要访问数据库来检索和操作数据。本文将重点介绍PHP数据库查询语句。一、什么是数据库查询语句在对数据库进行操作的过程中,我们常常需要从数据库中获取数据。这时,我们需要使用查询语句。数据库查询(SQL Query)是从数据库中检索数据的指令集。SQL是Structure

10 Mar 2025
本文探讨了PHP 7中的优化数据库查询。它解决了源于效率低下的查询,网络延迟和数据库服务器负载的性能瓶颈。策略包括使用适当的数据类型,索引,查询优化


Hot Tools
