asmblah/php-amqp-compat
最新稳定版本:v0.4.13
Composer 安装命令:
composer create-project asmblah/php-amqp-compat
包简介
README 文档
README
php-amqp/ext-amqp compatibility using php-amqplib.
Why?
php-amqp/librabbitmq does not fully support AMQP heartbeats,
they are only supported during blocking calls into the extension.
Heartbeat sender
With php-amqplib, we're able to send heartbeats more regularly, in multiple ways:
- Using a ReactPHP EventLoop with Envoylope EventLoop (recommended).
- Using UNIX System V signals with Envoylope ext-pcntl.
See the usage instructions for the packages above for installation.
Usage
First, remove ext-amqp - it cannot be used at the same time as this compatibility layer.
Usually, this will be with PECL:
$ pecl uninstall amqp
This is because the classes installed in the global/root namespace such as
AMQPConnectionwould conflict.
Second, install this package with Composer:
$ composer require asmblah/php-amqp-compat
Lastly, install the relevant heartbeat sender, if required.
That should be all the changes required - this userland library is designed as a drop-in replacement.
Limitations
- Persistent connections are not and cannot be supported from userland.
- If existing logic is checking for the
amqpextension viaextension_loaded('amqp'), it will fail because this library does not define an extension. During functional testing,extension_loaded(...)is hooked using PHP Code Shift to allow running tests from the reference implementation php-amqp/ext-amqp, see ReferenceImplementationTest.
See also
- The original php-amqp extension that this compatibility layer replaces: php-amqp/ext-amqp.
php-amqplib, which this library uses under the hood: php-amqplib.
统计信息
- 总下载量: 8.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-25