1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- declare(strict_types=1);
- /**
- * This file is part of Hyperf.
- *
- * @link https://www.hyperf.io
- * @document https://hyperf.wiki
- * @contact group@hyperf.io
- * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
- */
- namespace App\Listener;
- use Hyperf\Event\Annotation\Listener;
- use Hyperf\Event\Contract\ListenerInterface;
- use Nashgao\MQTT\Event\OnReceiveEvent;
- /**
- * mqtt 信号处理器
- */
- #[Listener]
- class MqttListener implements ListenerInterface
- {
- public function listen(): array
- {
- return [
- OnReceiveEvent::class,
- ];
- }
- /**
- * @param OnReceiveEvent $event
- * @return void
- */
- public function process($event): void
- {
- dd($event->message);
- }
- }
|