colearn/rabbitmq
Composer 安装命令:
composer require colearn/rabbitmq
包简介
Follow guide https://www.rabbitmq.com/ to create a library easy to use. For Laravel!
关键字:
README 文档
README
Installation
Install via composer
composer require colearn/rabbitmq
Publish package assets
php artisan vendor:publish --provider="CoLearn\RabbitMQ\RabbitMQServiceProvider"
Security
If you discover any security related issues, please email instead of using the issue tracker.
How to use
####Server RPC as service
$this->rabbit = app('rabbitmq.queue')->connection('rabbitmq');
RabbitMQ::declareRPCServer($this->rabbit, 'name_of_queue', function ($request) {
# code...
});
####Client RPC as service
$this->rabbit = app('rabbitmq.queue')->connection('rabbitmq');
$stringInput = json_encode(array);
$response = RabbitMQ::declareRPCClient($this->rabbit, 'name_of_queue', $stringInput);
####Server Worker Queue service
$this->rabbit = app('rabbitmq.queue')->connection('rabbitmq');
RabbitMQ::declareWorkerQueueServer($this->rabbit, 'name_of_queue', function ($request) {
RabbitMQ::declareAck($request);
});
统计信息
- 总下载量: 54
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-30