doc:更新文档
This commit is contained in:
parent
9306016fbe
commit
4710f9c6ea
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user