所有使用workerman的项目中,在运行时都会有一个Worker::runAll()方法

到底这个WokerAll()方法中执行了一个怎样的过程,具体如下:

    /**
     * Run all worker instances.
     * 运行所有worker实例
     * @return void
     */
    public static function runAll()
    {
        static::checkSapiEnv();       // 检查sapi环境变量--sapi指的是php运行的环境接口,其中$_os在workerman中默认是linux环境
        static::init();               // 初始化
        static::lock();
        static::parseCommand();
        static::daemonize();
        static::initWorkers();
        static::installSignal();
        static::saveMasterPid();
        static::unlock();
        static::displayUI();
        static::forkWorkers();
        static::resetStd();
        static::monitorWorkers();
    }
文档更新时间: 2021-06-16 21:50   作者:admin