示例#1
0
文件: Master.php 项目: eyehere/aha
 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));
         }
     });
 }
示例#2
0
文件: Signal.php 项目: eyehere/aha
 protected function _killAllProcess()
 {
     $this->_sigterm = true;
     $workers = \Daemon\Library\Ipc\Manager::getInstance()->getWorkersPid();
     foreach ($workers as $pid) {
         \swoole_process::kill($pid, SIGUSR1);
     }
 }