/** * @brief 子进程进入控制调度 */ protected function _start() { //进程刚拉起来的时候先做任务的状态复位(重启、升级、进程异常退出在拉起的情况) $objModel = new \Daemon\Models\Demo($this->_objAha); $ret = (yield $objModel->dbTrans()); //重置中间状态失败 退出事件循环 等待master重新拉起进程 if (false === $ret) { Log::monitor()->error(array(Monitor::KEY => Monitor::RESET_PROCESSING_ERR)); \swoole_event_exit(); } else { //重置中间状态成功 初始化定时器 $this->_initTimer(); } }