@param InputInterface   $input
@param OutputInterface  $output
@param QueueInterface   $queue
@param ProcessesManager $processManager

@return array
15142
private function doExecute(
        InputInterface $input,
        OutputInterface $output,
        QueueInterface $queue,
        ProcessesManager $processManager
    ) {
        $processes = null;

        if ($this->isVerbose($output)) {
            $progressBar = new VerboseRenderer($queue->count(), $this->hasErrorSummary($input), $output);
        } else {
            $progressBar = new ProgressBarRenderer($queue->count(), $this->hasErrorSummary($input), $output, new ProgressBar($output));
        }

        $progressBar->renderHeader($queue);

        while ($processManager->assertNProcessRunning($queue, $processes)) {
            $progressBar->renderBody($queue, $processes);
        }

        /*
         * @var Processes $processes
         */
        $processes->cleanUP(); //it is not getting called with -p1 after the last process otherwise
        $processes->wait(function () use ($progressBar, $queue, $processes) {
            $progressBar->renderBody($queue, $processes);
        });
        $progressBar->renderFooter($queue, $processes);

        return $processes;
    }
490008
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $logger = $this->getContainer()->get('ringo_php_redmon.instance_logger');
        $manager = $this->getContainer()->get('ringo_php_redmon.instance_manager');
        $instances = $manager->findAll();
        
        if(is_array($instances)) {
            foreach($instances as $instance) {
                $logger
                    ->setInstance($instance)
                    ->execute();
            }
        }
    }
1366933
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $inputs = array_merge($input->getArguments(), $input->getOptions());

        $parameters = array();

        //
        $reflection = new ReflectionFunction($this->callback);

        foreach ($reflection->getParameters() as $parameter) {
            if (isset($inputs[$parameter->name])) {
                $parameters[$parameter->name] = $inputs[$parameter->name];
            }
        }

        return $this->container->call(
            $this->callback->bindTo($this, $this), $parameters
        );
    }
1029177
protected function execute(
        InputInterface $input,
        OutputInterface $output
    ): int {
        /*
         * Define all channels this command must listen to
         */
        $this->define();

        $channelAliases = array_keys($this->methods);
        $channels = $this
            ->queueAliasResolver
            ->getQueues($channelAliases);

        if ($this->shuffleQueues()) {
            shuffle($channels);
        }

        $this
            ->redis
            ->subscribe($channels,
                function ($redis, $channel, $payloadSerialized) use ($input, $output) {
                    $channelAlias = $this
                    ->queueAliasResolver
                    ->getQueue($channel);

                    $method = $this->methods[$channelAlias];
                    $payload = $this
                    ->serializer
                    ->revert($payloadSerialized);

                    /*
                     * Dispatching subscriber event...
                     */
                    $subscriberEvent = new RSQueueSubscriberEvent(
                    $payload,
                    $payloadSerialized,
                    $channelAlias,
                    $channel,
                    $redis
                );

                    $this
                    ->eventDispatcher
                    ->dispatch(
                        RSQueueEvents::RSQUEUE_SUBSCRIBER,
                        $subscriberEvent
                    );

                    /*
                     * All custom methods must have these parameters
                     *
                     * InputInterface  $input   An InputInterface instance
                     * OutputInterface $output  An OutputInterface instance
                     * Mixed           $payload Payload
                     */
                    $this->$method(
                    $input,
                    $output,
                    $payload
                );
                });

        $this->beforeDie();

        return 0;
    }
22261
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $success = $this->_queue->runNextJob();
        if ($success === true) {
            $output->writeln("Queue Processed.");
        } elseif ($success === false) {
            $output->writeln("Job failed.");
        } else {
            $output->writeln("No jobs in queue.");
        }
    }
767657
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->stdOut->writeln("<info>Syncing Platform.sh environment database to local</info>");

        /** @var \Symfony\Component\Console\Helper\ProcessHelper $process */
        $process = $this->getHelper('process');

        // If this is a Platform.sh project, get latest dump.
        // @todo: add proper provider integration
        if (Config::get('id')) {
            $process->mustRun($this->stdOut, [
              'platform',
              'sql-dump',
            ]);
        }

        $cd = getcwd();
        chdir(Platform::webDir());
        $process->run($this->stdOut, 'drush sqlc < ' . $input->getArgument('file'));
        chdir($cd);
    }
275254
protected function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var \Symfony\Component\Console\Helper\ProcessHelper $process */
        $process = $this->getHelper('process');
        $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
        if (!is_dir(Platform::rootDir() . '/docker/fg')) {
            $process->mustRun($output, [
                'git',
                'clone',
                'https://github.com/brendangregg/FlameGraph.git',
              Platform::rootDir() . '/docker/fg'
            ]);
        }
        if (!is_dir(Platform::rootDir() . '/docker/xhpfg')) {
            $process->mustRun($output, [
              'git',
              'clone',
              'https://github.com/msonnabaum/xhprof-flamegraphs.git',
              Platform::rootDir() . '/docker/xhpfg'
            ]);
        }

        $stack = StacksFactory::getStack(Platform::webDir());
        switch ($stack->type()) {
            case Stacks\Drupal::TYPE:
                $this->stdOut->writeln("<comment>Patching Drupal for xhprof</comment>");
                $patchProcess = new Process(
                  'patch -p1 < ' . CLI_ROOT . '/resources/drupal-enable-profiling.patch',
                  Platform::webDir()
                );
                break;
            case Stacks\WordPress::TYPE:
                $this->stdOut->writeln("<comment>Patching WordPress for xhprof</comment>");
                $patchProcess = new Process(
                  'patch -p0 < ' . CLI_ROOT . '/resources/wordpress-enable-profiling.patch',
                  Platform::webDir()
                );
                break;
            default:
                throw new \Exception('Stack type not supported yet.');
        }
        $patchProcess->mustRun();
    }
428273
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $name = $input->getArgument('name');
        $aggregated = $this->inputsAggregator->getAggregated($name);
        if ($aggregated instanceof AbstractInput) {
            try {
                $output->writeln($aggregated->getValue());
            } catch (\Exception $e) {
                $output->writeln($e->getMessage());
            }
        } else {
            $output->writeln('This input does not exists');
        }
    }
529459
protected function execute(InputInterface $input, OutputInterface $output) {
		$trn_running = \Skeleton\Transaction\Transaction::get_running();
		$trn_runnable = \Skeleton\Transaction\Transaction::get_runnable();
		$trn_scheduled = \Skeleton\Transaction\Transaction::get_scheduled();

		$table = new Table($output);

		$table->setHeaders(['ID', 'Type', 'Scheduled at', '//']);

		$rows = [];

		$rows[] = [ new TableCell('Running', array('colspan' => 4)) ];
		$rows[] = new TableSeparator();
		$running_count = 0;
		foreach ($trn_running as $transaction) {
			if ($transaction->parallel == 0) {
				$rows[] = [ $transaction->id, $transaction->classname, $transaction->scheduled_at, $this->show_parallel($transaction) ];
				$running_count++;
			}
		}
		if ($running_count == 0) {
			$rows[] = [ 'FREE', 'FREE', 'FREE', 'NO' ];
			$running_count++;
		}
		foreach ($trn_running as $transaction) {
			if ($transaction->parallel == 1) {
				$rows[] = [ $transaction->id, $transaction->classname, $transaction->scheduled_at, $this->show_parallel($transaction) ];
				$running_count++;
			}
		}
		for ($i = $running_count; $i < \Skeleton\Transaction\Config::$max_processes; $i++) {
			$rows[] = [ 'FREE', 'FREE', 'FREE', '' ];
		}

		$rows[] = new TableSeparator();

		$rows[] = [ new TableCell('Ready to run', array('colspan' => 3)) ];
		$rows[] = new TableSeparator();
		foreach ($trn_runnable as $transaction) {
			$rows[] = [ $transaction->id, $transaction->classname, $transaction->scheduled_at, $this->show_parallel($transaction) ];
		}
		if (sizeof($trn_runnable) == 0) {
			$rows[] = [ '/', '/', '/', '/' ];
		}

		$rows[] = new TableSeparator();
		$rows[] = [ new TableCell('Scheduled', array('colspan' => 3)) ];
		$rows[] = new TableSeparator();
		foreach ($trn_scheduled as $transaction) {
			$rows[] = [ $transaction->id, $transaction->classname, $transaction->scheduled_at, $this->show_parallel($transaction) ];
		}
		if (sizeof($trn_scheduled) == 0) {
			$rows[] = [ '/', '/', '/', '/' ];
		}
		$table->setRows($rows);
		$table->render();

		return 0;
	}
109679
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $start = microtime(true);

        $this->getContainer()->get('ez_migration_bundle.step_executed_listener.tracing')->setOutput($output);

        $workflowService = $this->getWorkflowService();

        $workflowName = $input->getOption('workflow');
        if ($workflowName != null) {
            $suspendedWorkflow = $workflowService->getWorkflow($workflowName);
            if (!$suspendedWorkflow) {
                throw new \Exception("Workflow '$workflowName' not found");
            }
            if ($suspendedWorkflow->status != Migration::STATUS_SUSPENDED) {
                throw new \Exception("Workflow '$workflowName' is not suspended, can not resume it");
            }

            $suspendedWorkflows = array($suspendedWorkflow);
        } else {
            $suspendedWorkflows = $workflowService->getWorkflowsByStatus(Migration::STATUS_SUSPENDED);
        };

        $output->writeln('<info>Found ' . count($suspendedWorkflows) . ' suspended workflows</info>');

        if (!count($suspendedWorkflows)) {
            $output->writeln('Nothing to do');
            return;
        }

        // ask user for confirmation to make changes
        if ($input->isInteractive() && !$input->getOption('no-interaction')) {
            $dialog = $this->getHelperSet()->get('dialog');
            if (!$dialog->askConfirmation(
                $output,
                '<question>Careful, the database will be modified. Do you want to continue Y/N ?</question>',
                false
            )
            ) {
                $output->writeln('<error>Workflow resuming cancelled!</error>');
                return 0;
            }
        }

        $executed = 0;
        $failed = 0;

        foreach($suspendedWorkflows as $suspendedWorkflow) {
            $output->writeln("<info>Resuming {$suspendedWorkflow->name}</info>");

            try {
                $workflowService->resumeWorkflow($suspendedWorkflow, !$input->getOption('no-transactions'));
                $executed++;
            } catch (\Exception $e) {
                $output->writeln("\n<error>Workflow failed! Reason: " . $e->getMessage() . "</error>\n");
                $failed++;
            }
        }

        $time = microtime(true) - $start;
        $output->writeln("Resumed $executed workflows, failed $failed");
        $output->writeln("Time taken: ".sprintf('%.2f', $time)." secs, memory: ".sprintf('%.2f', (memory_get_peak_usage(true) / 1000000)). ' MB');

        if ($failed) {
            return 2;
        }
    }
937215
protected function getOptions(InputInterface $input)
    {
        $options = $this->extras + [
            'queue' => $input->getArgument('queue'),
            'connection' => $input->getArgument('connection'),
            'poll_interval' => (int) $input->getOption('poll-interval'),
        ];

        /** @var ProcessorConfiguratorInterface $processorConfigurator */
        foreach ($this->processorConfigurators as $processorConfigurator) {
            $processorOptions = $processorConfigurator->resolveOptions($input);

            if ($processorConfigurator->isEnabled()) {
                $options += $processorOptions;
            }
        }

        return $options;
    }
1073877
protected function execute(InputInterface $input, OutputInterface $output)
    {
        foreach ($this->classes as $className) {
            $output->write('Generating "<info>' . $className . '</info>" ');
            $this->hydratorFactory->getHydratorClassName($className);
            $output->writeLn('<comment>Done</comment>');
        }
    }
227191
private function generateOutput(InputInterface $input): OutputInterface
    {
        return new Output(
            $this->name,
            array_merge(
                $this->evaluateInputExports($input),
                $this->generateOutputParams($input)
            )
        );
    }
104703
public function process(InputInterface $input, OutputInterface $output)
    {
        $listFeatures = $input->getOption('list-features');
        $listScenarios = $input->getOption('list-scenarios');

        if (!$listFeatures && !$listScenarios) {
            return;
        }

        $results = [];
        $featurePaths = $this->container->get('behat.console.command')->getFeaturesPaths();
        foreach ($featurePaths as $featurePath) {
            if ($listFeatures) {
                $results = array_merge($results, $this->_getFeatureFiles($featurePath));
            } else {
                $results = array_merge($results, $this->_getScenarios($featurePath));
            }
        }

        $output->writeln(implode(PHP_EOL, $results));
        exit(0);
    }
342961
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->cacheService->system()->clear();
        $this->cacheService->user()->clear();
        $output->writeln('Done!');
        return null;
    }
159458
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($input->getOption('list-info-collectors')) {
            $output->writeln('Available info collectors:', true);
            foreach ($this->systemInfoCollectorRegistry->getIdentifiers() as $identifier) {
                $output->writeln("  $identifier", true);
            }

            return;
        }

        $outputFormatter = $this->outputFormatRegistry->getItem(
            $input->getOption('format')
         );

        if ($input->getArgument('info-collectors')) {
            $identifiers = $input->getArgument('info-collectors');
        } else {
            $identifiers = $this->systemInfoCollectorRegistry->getIdentifiers();
        }

        // Collect info for the given identifiers.
        $collectedInfoArray = [];
        foreach ($identifiers as $identifier) {
            $collectedInfoArray[$identifier] = $this->systemInfoCollectorRegistry->getItem($identifier)->collect();
        }

        $output->writeln(
             $outputFormatter->format($collectedInfoArray)
         );
    }
1275154
public function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input  = $input;
        $this->output = $output;
        $logger       = $this->logger;

        Resque_Event::listen(
            'onFailure',
            function ($exception, $job) use ($logger) {
                $logger->error('Error processing job', [
                    'exception' => $exception
                ]);
            }
        );

        if ($input->getOption('shutdown')) {
            $this->shutdownWorkers();
            return;
        }

        $queues = $input->getArgument('queue');
        if (! count($queues)) {
            throw new RuntimeException('Not enough arguments.');
        }

        $count    = $input->getOption('count');
        $interval = $input->getOption('interval');

        if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE) {
            $logLevel = Resque_Worker::LOG_NORMAL;
        } elseif ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE) {
            $logLevel = Resque_Worker::LOG_VERBOSE;
        } else {
            $logLevel = Resque_Worker::LOG_NONE;
        }

        $this->startWorkers($queues, $count, $logLevel, $interval);
    }