protected function startWorkerPool(string $poolName, array $poolConfig)
    {
        if (!isset($poolConfig['worker_file'])) {
            throw new ServerException('Path to worker file not set in pool config.');
        }

        $this->processes[$poolName] = [];
        $processesToStart = $poolConfig['cp_start'] ?? 5;
        for ($i = 0; $i < $processesToStart; $i++) {
            // start child process:
            try {
                $process = $this->startChildProcess($poolConfig['worker_file']);
                $this->registerChildProcess($process, $poolName);
            } catch (\Exception $e) {
                throw new ServerException('Could not start child process.');
            }
        }
    }
protected function startWorkerPool(string $poolName, array $poolConfig)
    {
        if (!isset($poolConfig['worker_file'])) {
            throw new ServerException('Path to worker file not set in pool config.');
        }

        $this->processes[$poolName] = [];
        $processesToStart = $poolConfig['cp_start'] ?? 5;
        for ($i = 0; $i < $processesToStart; $i++) {
            // start child process:
            try {
                $process = $this->startChildProcess($poolConfig['worker_file']);
                $this->registerChildProcess($process, $poolName);
            } catch (\Exception $e) {
                throw new ServerException('Could not start child process.');
            }
        }
    }
protected function startWorkerPool ( string $ poolName , array $ poolConfig ) { if ( ! isset ( $ poolConfig [ 'worker_file' ] ) ) { throw new ServerException ( 'Path to worker file not set in pool config.' ) ; } $ this -> processes [ $ poolName ] = [ ] ; $ processesToStart = $ poolConfig [ 'cp_start' ] ?? 5 ; for ( $ i = 0 ; $ i < $ processesToStart ; $ i ++ ) { // start child process: try { $ process = $ this -> startChildProcess ( $ poolConfig [ 'worker_file' ] ) ; $ this -> registerChildProcess ( $ process , $ poolName ) ; } catch ( \ Exception $ e ) { throw new ServerException ( 'Could not start child process.' ) ; } } }
Starts child processes as defined in pool configuration.

@param string $poolName
@param array $poolConfig
@throws ServerException
Starts child processes as defined in pool configuration .