/**
  * Executes the current command.
  *
  * @param InputInterface  $input  An InputInterface instance
  * @param OutputInterface $output An OutputInterface instance
  *
  * @return integer 0 if everything went fine, or an error code
  *
  * @throws \LogicException When this abstract class is not implemented
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     /**
      * @var QuestionHelper $question
      */
     $question = $this->getHelperSet()->get('question');
     if (!$input->getOption('no-interaction') && !$question->ask($input, $output, new ConfirmationQuestion('This will execute asked job?'))) {
         return;
     }
     if (!$input->getOption('quiet')) {
         $output->writeln(sprintf('<info>[%s] loading...</info>', date('Y-m-d H:i:s')));
     }
     $job = $input->getArgument('job');
     $jobStructure = $this->gearmanClient->getJob($job);
     if (!$input->getOption('no-description') && !$input->getOption('quiet')) {
         $this->gearmanDescriber->describeJob($output, $jobStructure, true);
     }
     if (!$input->getOption('quiet')) {
         $output->writeln(sprintf('<info>[%s] loaded. Ctrl+C to break</info>', date('Y-m-d H:i:s')));
     }
     $this->gearmanExecute->setOutput($output)->executeJob($job, array('iterations' => $input->getOption('iterations'), 'minimum_execution_time' => $input->getOption('minimum-execution-time'), 'timeout' => $input->getOption('timeout')));
 }
 /**
  * Executes the current command.
  *
  * @param InputInterface  $input  An InputInterface instance
  * @param OutputInterface $output An OutputInterface instance
  *
  * @return integer 0 if everything went fine, or an error code
  *
  * @throws \LogicException When this abstract class is not implemented
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     /**
      * @var DialogHelper $dialog
      */
     $dialog = $this->getHelperSet()->get('dialog');
     if (!$input->getOption('no-interaction') && !$dialog->askConfirmation($output, '<question>This will execute asked job?</question>', 'y')) {
         return;
     }
     if (!$input->getOption('quiet')) {
         $output->writeln(sprintf('<info>[%s] loading...</info>', date('Y-m-d H:i:s')));
     }
     $job = $input->getArgument('job');
     $jobStructure = $this->gearmanClient->getJob($job);
     if (!$input->getOption('quiet')) {
         $this->gearmanDescriber->describeJob($output, $jobStructure, true);
     }
     if (!$input->getOption('quiet')) {
         $output->writeln(sprintf('<info>[%s] loaded. Ctrl+C to break</info>', date('Y-m-d H:i:s')));
     }
     $this->gearmanExecute->setOutput($output)->executeJob($job);
 }
 /**
  * Executes the current command.
  *
  * @param InputInterface  $input  An InputInterface instance
  * @param OutputInterface $output An OutputInterface instance
  *
  * @return integer 0 if everything went fine, or an error code
  *
  * @throws \LogicException When this abstract class is not implemented
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $job = $input->getArgument('job');
     $job = $this->gearmanClient->getJob($job);
     $this->gearmanDescriber->describeJob($output, $job);
 }