mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 07:35:34 +08:00
enhancement for process state
This commit is contained in:
@@ -25,9 +25,6 @@ use ZM\Event\SwooleEvent;
|
||||
*/
|
||||
class OnMessage implements SwooleEvent
|
||||
{
|
||||
/**
|
||||
* @noinspection PhpUnreachableStatementInspection
|
||||
*/
|
||||
public function onCall($server, Frame $frame) {
|
||||
Console::debug("Calling Swoole \"message\" from fd=" . $frame->fd . ": " . TermColor::ITALIC . $frame->data . TermColor::RESET);
|
||||
unset(Context::$context[Coroutine::getCid()]);
|
||||
|
||||
@@ -10,7 +10,7 @@ use Swoole\Server;
|
||||
use ZM\Annotation\Swoole\SwooleHandler;
|
||||
use ZM\Console\Console;
|
||||
use ZM\Event\SwooleEvent;
|
||||
use ZM\Utils\Manager\ProcessManager;
|
||||
use ZM\Utils\Manager\WorkerManager;
|
||||
|
||||
/**
|
||||
* Class OnPipeMessage
|
||||
@@ -22,7 +22,7 @@ class OnPipeMessage implements SwooleEvent
|
||||
public function onCall(Server $server, $src_worker_id, $data) {
|
||||
$data = json_decode($data, true);
|
||||
try {
|
||||
ProcessManager::workerAction($src_worker_id, $data);
|
||||
WorkerManager::workerAction($src_worker_id, $data);
|
||||
} catch (Exception $e) {
|
||||
$error_msg = $e->getMessage() . " at " . $e->getFile() . "(" . $e->getLine() . ")";
|
||||
Console::error(zm_internal_errcode("E00021") . "Uncaught exception " . get_class($e) . " when calling \"pipeMessage\": " . $error_msg);
|
||||
|
||||
Reference in New Issue
Block a user