protected function _initTimer() { $redoConf = $this->_objAha->getConfig()->get('aha', 'stats'); $statsInterval = $redoConf['stats_interval']; swoole_timer_tick($statsInterval, function () { $objManager = \Daemon\Library\Ipc\Manager::getInstance(); $workers = $objManager->getWorkersPid(); $arrStatsWorker = $objManager->getStatsWorker(); if (!empty($arrStatsWorker)) { list($statsPid, $statsWorker) = each($arrStatsWorker); $statsWorker->write(serialize($workers)); } }); }
protected function _killAllProcess() { $this->_sigterm = true; $workers = \Daemon\Library\Ipc\Manager::getInstance()->getWorkersPid(); foreach ($workers as $pid) { \swoole_process::kill($pid, SIGUSR1); } }