public function onWorkerStart(\Swoole\Server $server, int $worker_id)
    {
        // STDOUT_LOG模式，不打印 worker stop 输出
        if ( getenv('STDOUT_LOG') ) {
            echo date('Y-m-d H:i:s') . " |\033[31m ...... http worker process start[id={$worker_id} pid={$server->worker_pid}] ......\033[0m \n";
        }

        // Add event Listener
        $this->add_event_listener('onWorkerStart');
    }
public function onWorkerStart(\Swoole\Server $server, int $worker_id)
    {
        // STDOUT_LOG模式，不打印 worker stop 输出
        if ( getenv('STDOUT_LOG') ) {
            echo date('Y-m-d H:i:s') . " |\033[31m ...... http worker process start[id={$worker_id} pid={$server->worker_pid}] ......\033[0m \n";
        }

        // Add event Listener
        $this->add_event_listener('onWorkerStart');
    }
public function onWorkerStart ( \ Swoole \ Server $ server , int $ worker_id ) { // STDOUT_LOG模式，不打印 worker stop 输出 if ( getenv ( 'STDOUT_LOG' ) ) { echo date ( 'Y-m-d H:i:s' ) . " |\033[31m ...... http worker process start[id={$worker_id} pid={$server->worker_pid}] ......\033[0m \n" ; } // Add event Listener $ this -> add_event_listener ( 'onWorkerStart' ) ; }
On wroker started

@param \Swoole\Server $server
@param integer $worker_id
@return void
On wroker started