2022-01-12 11:29:50 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Kiri\Server\Broadcast;
|
|
|
|
|
|
|
|
|
|
|
2022-01-12 14:10:32 +08:00
|
|
|
use Kiri;
|
2022-01-12 11:29:50 +08:00
|
|
|
use Kiri\Server\Contract\OnPipeMessageInterface;
|
2022-01-12 11:41:26 +08:00
|
|
|
use Psr\Log\LoggerInterface;
|
2022-01-12 11:29:50 +08:00
|
|
|
|
2022-01-12 11:52:58 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
class Message implements OnPipeMessageInterface, OnBroadcastInterface
|
2022-01-12 11:29:50 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param mixed $data
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(public mixed $data)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function process(): void
|
|
|
|
|
{
|
2022-01-12 11:41:26 +08:00
|
|
|
$logger = Kiri::getDi()->get(LoggerInterface::class);
|
2022-01-12 11:52:58 +08:00
|
|
|
$logger->debug(env('environmental') . '::' . env('environmental_workerId', 0) . '::' . $this->data);
|
2022-01-12 11:29:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|