romeoz/rock-mq
最新稳定版本:0.10.0
Composer 安装命令:
composer require romeoz/rock-mq
包简介
Unified API for message queue services
README 文档
README
Features
- Background sending
- Pub/Sub
- Non-blocking
- Module for Rock Framework
Installation
From the Command Line:
composer require romeoz/rock-mq:*@dev
In your composer.json:
{
"require": {
"romeoz/rock-mq": "*@dev"
}
}
Quick Start
Run broker:
php tests/data/mq/rabbit/simple_server.php &
Code:
use rock\mq\RabbitQueue; $rabbit = new RabbitQueue(); $rabbit->send('test'); // result: "Hi! I am server: test" // or background $rabbit->sendBackground('test');
####Pub/Sub
Run broker:
php tests/data/mq/rabbit/pub_server.php &
Code:
use rock\mq\RabbitQueue; $rabbit = new RabbitQueue(); $rabbit->blocking = false; $rabbit->type = 'direct'; $rabbit->exchange = 'direct_test'; $rabbit->subscribe('foo'); // result: "Hi! I am server: foo"
Requirements
- PHP 5.4+
- Gearman should be installed
apt-get install libgearman7. Also, should be installed PHP extensionapt-get install php5-gearman - RabbitMQ should be installed
apt-get install rabbitmq-server. - ZeroMQ should be installed
apt-get install libzmq3. Also, should be installed PHP extensionapt-get install php-zmq
Note: if you have problems with the installation, then see config .travis.
License
A message queue API is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-02