增加USR1信号,实时获取 worker 信息

This commit is contained in:
JaguarJack
2020-07-09 10:04:31 +08:00
parent 104ad3f744
commit a5b6b479ce
4 changed files with 70 additions and 26 deletions

View File

@@ -84,10 +84,10 @@ class ManageProcess
$this->timeTick(1000, $this->schedule());
// 注册信号
$this->registerSignal();
// 存储 pid
$this->storeMasterPid(getmypid());
// pid
$this->master_pid = getmypid();
// 存储 pid
$this->storeMasterPid($this->master_pid);
// 初始化进程
$this->initProcesses();
}
@@ -148,8 +148,7 @@ class ManageProcess
protected function createProcess(Cron $cron)
{
$process = new Process(function (Process $process) use($cron) {
echo 'hello world';
//$cron->run();
$cron->run();
$process->exit();
});
@@ -195,6 +194,8 @@ class ManageProcess
$this->storeStatus($this->processInfo($process));
}
$this->saveProcessStatus();
}
/**