純PHP AMQP庫
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
相關文章

17Feb2025
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

21Jul2016
PHP腳本資料庫功能詳解(下)。用類別加快PHP的資料庫開發 資料庫的存取函數較多,使用不當會降低效率,甚至導致錯誤。而PHP的本身就是開放的、可擴充的,很多人為它開


Hot Tools

熱門文章
丟失記錄:Bloom&Rage -Corey和Dylan的鎖組合
19Feb2025手游攻略
王國來:拯救2-婚禮要買的衣服
05Feb2025手游攻略
王國來:拯救2-如何獲得Comfrey
07Feb2025手游攻略
Longvinter:完整的釣魚指南
21Feb2025手游攻略
Hello Kitty Island冒險:重新啟動機器人任務演練
16Feb2025手游攻略