改名
This commit is contained in:
@@ -4,14 +4,35 @@
|
||||
namespace HttpServer\Events;
|
||||
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Events\Abstracts\Callback;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Snowflake;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
* Class OnPipeMessage
|
||||
* @package HttpServer\Events
|
||||
*/
|
||||
class OnPipeMessage extends Callback
|
||||
{
|
||||
|
||||
public function onHandler()
|
||||
/**
|
||||
* @param Server $server
|
||||
* @param int $src_worker_id
|
||||
* @param $message
|
||||
* @throws ComponentException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function onHandler(Server $server, int $src_worker_id, $message)
|
||||
{
|
||||
// TODO: Implement onHandler() method.
|
||||
$events = Snowflake::get()->getEvent();
|
||||
if (!$events->exists(Event::PIPE_MESSAGE)) {
|
||||
return;
|
||||
}
|
||||
$events->trigger(Event::PIPE_MESSAGE, [$server, $src_worker_id, $message]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user