protected function launchWorker(): bool {
        $this->log(LogLevel::DEBUG, "[{pid}]   launching fleet worker");

        // Prepare current state prior to forking
        $workerConfig = $this->payloadExec('getWorkerConfig');
        if ($workerConfig === false) {
            $this->log(LogLevel::DEBUG, "[{pid}]    launch cancelled by payload");
            return false;
        }

        $this->fork('fleet', $workerConfig);

        // Return daemon thread
        if ($this->realm != 'worker') {
            return true;
        }

        /*
         *
         * WORKER THREADS BELOW
         *
         */

        // Unhandle SIGINT, SIGTERM, SIGCHLD
        pcntl_signal(SIGINT, SIG_DFL);
        pcntl_signal(SIGTERM, SIG_DFL);
        pcntl_signal(SIGCHLD, SIG_DFL);

        // Move handling of SIGHUP, SIGUSR1, SIGUSR2 to workerSignal()
        pcntl_signal(SIGHUP, [$this, 'workerSignal']);
        pcntl_signal(SIGUSR1, [$this, 'workerSignal']);
        pcntl_signal(SIGUSR2, [$this, 'workerSignal']);

        $exitCode = $this->runPayloadApplication($workerConfig);
        exit($exitCode);
    }
protected function launchWorker(): bool {
        $this->log(LogLevel::DEBUG, "[{pid}]   launching fleet worker");

        // Prepare current state prior to forking
        $workerConfig = $this->payloadExec('getWorkerConfig');
        if ($workerConfig === false) {
            $this->log(LogLevel::DEBUG, "[{pid}]    launch cancelled by payload");
            return false;
        }

        $this->fork('fleet', $workerConfig);

        // Return daemon thread
        if ($this->realm != 'worker') {
            return true;
        }

        /*
         *
         * WORKER THREADS BELOW
         *
         */

        // Unhandle SIGINT, SIGTERM, SIGCHLD
        pcntl_signal(SIGINT, SIG_DFL);
        pcntl_signal(SIGTERM, SIG_DFL);
        pcntl_signal(SIGCHLD, SIG_DFL);

        // Move handling of SIGHUP, SIGUSR1, SIGUSR2 to workerSignal()
        pcntl_signal(SIGHUP, [$this, 'workerSignal']);
        pcntl_signal(SIGUSR1, [$this, 'workerSignal']);
        pcntl_signal(SIGUSR2, [$this, 'workerSignal']);

        $exitCode = $this->runPayloadApplication($workerConfig);
        exit($exitCode);
    }
protected function launchWorker ( ) : bool { $ this -> log ( LogLevel :: DEBUG , "[{pid}]   launching fleet worker" ) ; // Prepare current state prior to forking $ workerConfig = $ this -> payloadExec ( 'getWorkerConfig' ) ; if ( $ workerConfig === false ) { $ this -> log ( LogLevel :: DEBUG , "[{pid}]    launch cancelled by payload" ) ; return false ; } $ this -> fork ( 'fleet' , $ workerConfig ) ; // Return daemon thread if ( $ this -> realm != 'worker' ) { return true ; } /*
         *
         * WORKER THREADS BELOW
         *
         */ // Unhandle SIGINT, SIGTERM, SIGCHLD pcntl_signal ( SIGINT , SIG_DFL ) ; pcntl_signal ( SIGTERM , SIG_DFL ) ; pcntl_signal ( SIGCHLD , SIG_DFL ) ; // Move handling of SIGHUP, SIGUSR1, SIGUSR2 to workerSignal() pcntl_signal ( SIGHUP , [ $ this , 'workerSignal' ] ) ; pcntl_signal ( SIGUSR1 , [ $ this , 'workerSignal' ] ) ; pcntl_signal ( SIGUSR2 , [ $ this , 'workerSignal' ] ) ; $ exitCode = $ this -> runPayloadApplication ( $ workerConfig ) ; exit ( $ exitCode ) ; }
Launch a fleet worker

@return bool
Launch a fleet worker