Task/Process/ProcessLauncherTask.php
public function execute(ProcessState $state)
    {
        $this->handleProcesses($state); // Handler processes first

        $options = $this->getOptions($state);
        while (\count($this->launchedProcesses) >= $options['max_processes']) {
            $this->handleProcesses($state);
            sleep($options['sleep_interval']);
        }

        $process = $this->launchProcess($state);
        $this->launchedProcesses[] = $process;

        $logContext = [
            'input' => $process->getInput(),
        ];

        $this->logger->debug("Running command: {$process->getCommandLine()}", $logContext);

        sleep($options['sleep_interval_after_launch']);
    }
public function execute(ProcessState $state)
    {
        $this->handleProcesses($state); // Handler processes first

        $options = $this->getOptions($state);
        while (\count($this->launchedProcesses) >= $options['max_processes']) {
            $this->handleProcesses($state);
            sleep($options['sleep_interval']);
        }

        $process = $this->launchProcess($state);
        $this->launchedProcesses[] = $process;

        $logContext = [
            'input' => $process->getInput(),
        ];

        $this->logger->debug("Running command: {$process->getCommandLine()}", $logContext);

        sleep($options['sleep_interval_after_launch']);
    }
@param ProcessState $state

@throws \Symfony\Component\Process\Exception\LogicException
@throws \Symfony\Component\Process\Exception\RuntimeException
@throws \Symfony\Component\OptionsResolver\Exception\ExceptionInterface
@throws \Symfony\Component\Filesystem\Exception\IOException
@throws \InvalidArgumentException
@throws \RuntimeException
@throws \Symfony\Component\Process\Exception\InvalidArgumentException