takatost/php-pubsub-cmq
Composer 安装命令:
composer require takatost/php-pubsub-cmq
包简介
A Tencent CMQ adapter for the php-pubsub package.
README 文档
README
A Tencent CMQ adapter for the php-pubsub package.
Installation
composer require takatost/php-pubsub-cmq
Usage
$config = [ 'secret_key' => '', 'secret_id' => '', 'queue_end_point' => 'https://cmq-queue-sh.api.qcloud.com/v2/index.php', 'topic_end_point' => 'https://cmq-topic-sh.api.qcloud.com/v2/index.php', 'options' => [ 'debug' => false, 'timeout' => 10, ] ]; $adapter = new \Takatost\PubSub\CMQ\CMQPubSubAdapter($config); // consume messages // note: this is a blocking call $adapter->subscribe('topic_queue_name', function ($message) { var_dump($message); }); // publish messages $adapter->publish('topic_name', 'HELLO WORLD'); $adapter->publish('topic_name', json_encode(['hello' => 'world'])); $adapter->publish('topic_name', 1); $adapter->publish('topic_name', false);
统计信息
- 总下载量: 616
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-03-23