This commit is contained in:
2021-04-15 18:15:23 +08:00
parent ee25cdf3af
commit 47c1ab2086
2 changed files with 10 additions and 12 deletions
+8 -9
View File
@@ -19,20 +19,19 @@ use Swoole\Server;
class OnPipeMessage extends Callback
{
/**
* @param Server $server
* @param int $src_worker_id
* @param $message
* @throws Exception
*/
public function onHandler(Server $server, int $src_worker_id, $message)
/**
* @param Server $server
* @param int $src_worker_id
* @param $swollen_universalize
* @throws Exception
*/
public function onHandler(Server $server, int $src_worker_id, $swollen_universalize)
{
try {
$swollen_universalize = swoole_unserialize($message);
match ($swollen_universalize['action'] ?? null) {
'kafka' => $this->onKafkaWorker($swollen_universalize),
'crontab' => $this->onCrontabWorker($swollen_universalize),
default => $this->onMessageWorker($server, $src_worker_id, $message)
default => $this->onMessageWorker($server, $src_worker_id, $swollen_universalize)
};
} catch (\Throwable $exception) {
$this->addError($exception);