src/Leevel/Protocol/Server.php
public function onWorkerStart(SwooleServer $server, int $workeId): void
    {
        if ($workeId >= $this->option['worker_num']) {
            $this->setProcessName(
                $this->option['process_name'].'.task'
            );
        } else {
            $this->setProcessName(
                $this->option['process_name'].'.worker'
            );
        }

        // 开启 opcache 重连后需要刷新
        if (function_exists('opcache_reset')) {
            opcache_reset();
        }

        if (function_exists('apc_clear_cache')) {
            apc_clear_cache();
        }
    }
public function onWorkerStart(SwooleServer $server, int $workeId): void
    {
        if ($workeId >= $this->option['worker_num']) {
            $this->setProcessName(
                $this->option['process_name'].'.task'
            );
        } else {
            $this->setProcessName(
                $this->option['process_name'].'.worker'
            );
        }

        // 开启 opcache 重连后需要刷新
        if (function_exists('opcache_reset')) {
            opcache_reset();
        }

        if (function_exists('apc_clear_cache')) {
            apc_clear_cache();
        }
    }
worker start 加载业务脚本常驻内存
由于服务端命令行也采用 QueryPHP,无需再次引入 QueryPHP
每个 Worker 进程启动或重启时都会执行.

@param \Swoole\Server $server
@param int            $workeId

@see https://wiki.swoole.com/wiki/page/p-event/onWorkerStart.html