Mmoreram\RSQueueBundle\Command\ConsumerCommand::configure PHP Method

configure() protected method

Some options are included * timeout ( default: 0) * iterations ( default: 0) * sleep ( default: 0) Important !! All Commands with this consumer behaviour must call parent() configure method
protected configure ( )
    protected function configure()
    {
        $this->addOption('timeout', null, InputOption::VALUE_OPTIONAL, 'Consumer timeout.
                If 0, no timeout is set.
                Otherwise consumer will lose conection after timeout if queue is empty.
                By default, 0', 0)->addOption('iterations', null, InputOption::VALUE_OPTIONAL, 'Number of iterations before this command kills itself.
                If 0, consumer will listen queue until process is killed by hand or by exception.
                You can manage this behavour by using some Process Control System, e.g. Supervisord
                By default, 0', 0)->addOption('sleep', null, InputOption::VALUE_OPTIONAL, 'Timeout between each iteration ( in seconds ).
                If 0, no time will be waitted between them.
                Otherwise, php will sleep X seconds each iteration.
                By default, 0', 0);
    }

Usage Example

 /**
  * Configuration method
  */
 protected function configure()
 {
     $this->setName('videque:consumer')->setDescription('Fill media with metadata, start encoding for additional formats, create thumbnails');
     parent::configure();
 }