public function reload($onlyTaskWorker = false): int
    {
        if (!$masterPid = $this->getPidFromFile(true)) {
            return Show::error("The swoole server({$this->name}) is not running.", true);
        }

        // SIGUSR1: 向管理进程发送信号，将平稳地重启所有worker进程; 也可在PHP代码中调用`$server->reload()`完成此操作
        $sig = SIGUSR1;

        if ($onlyTaskWorker) {
            $sig = SIGUSR2;
            Show::notice('Will only reload task worker');
        }

        if (!ProcessUtil::sendSignal($masterPid, $sig)) {
            Show::error("The swoole server({$this->name}) worker process reload fail!", -1);
        }

        return Show::success("The swoole server({$this->name}) worker process reload success.", 0);
    }
public function reload($onlyTaskWorker = false): int
    {
        if (!$masterPid = $this->getPidFromFile(true)) {
            return Show::error("The swoole server({$this->name}) is not running.", true);
        }

        // SIGUSR1: 向管理进程发送信号，将平稳地重启所有worker进程; 也可在PHP代码中调用`$server->reload()`完成此操作
        $sig = SIGUSR1;

        if ($onlyTaskWorker) {
            $sig = SIGUSR2;
            Show::notice('Will only reload task worker');
        }

        if (!ProcessUtil::sendSignal($masterPid, $sig)) {
            Show::error("The swoole server({$this->name}) worker process reload fail!", -1);
        }

        return Show::success("The swoole server({$this->name}) worker process reload success.", 0);
    }
public function reload ( $ onlyTaskWorker = false ) : int { if ( ! $ masterPid = $ this -> getPidFromFile ( true ) ) { return Show :: error ( "The swoole server({$this->name}) is not running." , true ) ; } // SIGUSR1: 向管理进程发送信号，将平稳地重启所有worker进程; 也可在PHP代码中调用`$server->reload()`完成此操作 $ sig = SIGUSR1 ; if ( $ onlyTaskWorker ) { $ sig = SIGUSR2 ; Show :: notice ( 'Will only reload task worker' ) ; } if ( ! ProcessUtil :: sendSignal ( $ masterPid , $ sig ) ) { Show :: error ( "The swoole server({$this->name}) worker process reload fail!" , - 1 ) ; } return Show :: success ( "The swoole server({$this->name}) worker process reload success." , 0 ) ; }
do Reload Workers
@param  boolean $onlyTaskWorker
@return int
do Reload Workers