doc:更新文档

This commit is contained in:
zyimm 2023-07-11 14:26:17 +08:00
parent 9306016fbe
commit 4710f9c6ea
2 changed files with 9 additions and 1 deletions

View File

@ -70,6 +70,11 @@ class Consumer implements ListenerInterface
private $message;
/**
* 所有订阅监听会自动注入 tm\xls\rocketMq\thinkphp\consumer\message\Message 对象
*
* @param Message $message
*/
public function __construct(Message $message)
{
$this->message = $message;
@ -77,7 +82,10 @@ class Consumer implements ListenerInterface
public function handle()
{
//队列消息
$this->message;
//处理订阅逻辑
// code ...
}
public function enable(): bool

View File

@ -29,7 +29,7 @@ class Consumer
{
//事件循环
$loop = Loop::get();
$key = $this->message->getTopic().$this->message->getTag();
$key = $this->message->getTopic().'.'.$this->message->getTag();
$subscribes = $this->getSubscribe()[$key] ?? [];
foreach ($subscribes as $subscribe) {
$loop->addTimer(0, function () use ($subscribe) {