PHPPM\ProcessManager::setMaxRequests PHP Method

setMaxRequests() public method

public setMaxRequests ( integer $maxRequests )
$maxRequests integer
    public function setMaxRequests($maxRequests)
    {
        $this->maxRequests = $maxRequests;
    }

Usage Example

Example #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($workingDir = $input->getArgument('working-directory')) {
         chdir($workingDir);
     }
     $config = $this->loadConfig($input);
     if (file_exists($this->file)) {
         $modified = '';
         $fileConfig = json_decode(file_get_contents($this->file), true);
         if (json_encode($fileConfig) !== json_encode($config)) {
             $modified = ', modified by command arguments';
         }
         $output->writeln(sprintf('<info>Read configuration %s%s.</info>', realpath($this->file), $modified));
     }
     $output->writeln(sprintf('<info>%s</info>', getcwd()));
     $this->renderConfig($output, $config);
     $handler = new ProcessManager($output, $config['port'], $config['host'], $config['workers']);
     $handler->setBridge($config['bridge']);
     $handler->setAppEnv($config['app-env']);
     $handler->setDebug((bool) $config['debug']);
     $handler->setLogging((bool) $config['logging']);
     $handler->setAppBootstrap($config['bootstrap']);
     $handler->setMaxRequests($config['max-requests']);
     $handler->setPhpCgiExecutable($config['php-cgi']);
     $handler->setConcurrentRequestsPerWorker($config['concurrent-requests']);
     $handler->run();
 }
All Usage Examples Of PHPPM\ProcessManager::setMaxRequests