/** * @brief application run main function * @return \Aha\Bootstrap * @throws \Exception\ */ public function run() { $appPath = $this->_loader->getPathByByNamespace($this->_appNamespace); if (false === $appPath) { throw new \Exception("appPath of {$this->_appNamespace} is not registered!"); } //init config $this->_initConfig(); //init filter:在worker启动的时候 由开发者调用静态类的静态方法添加钩子 //(注册的钩子需要考虑异步情况下的并发问题 避免因为并发下处理同一个对象带来麻烦) $this->_initFilter(); //初始化router 注册action file \Aha\Mvc\Router::loadActionPaths($this); //初始化协程调度器 $this->_initScheduler(); return $this; }