/**
  * 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)
 {
     $helper = $this->getHelper('question');
     $question = new ConfirmationQuestion('<question>This will execute asked worker with all its jobs?</question>', 'y');
     if (!$input->getOption('no-interaction') && !$helper->ask($input, $output, $question)) {
         return;
     }
     if (!$input->getOption('quiet')) {
         $output->writeln(sprintf('<info>[%s] loading...</info>', date('Y-m-d H:i:s')));
     }
     $worker = $input->getArgument('worker');
     $workerStructure = $this->gearmanClient->getWorker($worker);
     if (!$input->getOption('no-description') && !$input->getOption('quiet')) {
         $this->gearmanDescriber->describeWorker($output, $workerStructure, 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)->executeWorker($worker, 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 QuestionHelper $helper
      */
     $helper = $this->getHelper('question');
     $question = new ConfirmationQuestion('<question>This will execute asked job?</question>', 'y');
     if (!$input->getOption('no-interaction') && !$helper->ask($input, $output, $question)) {
         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);
     }
     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')));
 }