mamluk/tavshan
最新稳定版本:1.4
Composer 安装命令:
composer require mamluk/tavshan
包简介
Tavshan by Mamluk - a simplified Rabbit MQ library written on top of the PHP AMQP Library
关键字:
README 文档
README
Tavshan is a simplified Rabbit MQ library written on top of the PHP AMQP Library. It doesn't utilise all the bells and whistles within Rabbit MQ yet, but will be enhanced as required (or with your contributions).
What does Tavshan mean?
It's actually tavşan (pronounced as tavshan), and means rabbit in Turkish.
How to use it?
Include it by adding mamluk/tavshan to your composer.json file.
use Mamluk\Tavshan\Queue
use Monolog\Logger;
use Psr\Log\LogLevel;
$logger = new Monolog\Logger('myQueue');
$logger->pushHandler(new StreamHandler('php://stdout', LogLevel::DEBUG));
$q = new Queue($config, $logger, 'queue_name', 1); // See __construct() src/Queue for what the config array requires
// Produce a message
$q->publish('My first message');
// Consume messages
$callback = function ($msg) {
echo ' [x] Received ', $msg->body, "\n";
};
$this->q->subscribe($callback, 'queue_name');
License
MIT
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-03