Mmoreram\RSQueueBundle\Command\PSubscriberCommand::execute PHP Метод

execute() защищенный Метод

Execute code.
protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface An InputInterface instance
$output Symfony\Component\Console\Output\OutputInterface An OutputInterface instance
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->define();
        $serializer = $this->getContainer()->get('rs_queue.serializer');
        $psubscriberCommand = $this;
        $methods = $this->methods;
        $patterns = array_keys($methods);
        if ($this->shuffleQueues()) {
            shuffle($patterns);
        }
        $this->getContainer()->get('rs_queue.redis')->psubscribe($patterns, function ($redis, $pattern, $channel, $payloadSerialized) use($methods, $psubscriberCommand, $serializer, $input, $output) {
            $payload = $serializer->revert($payloadSerialized);
            $method = $methods[$pattern];
            /**
             * All custom methods must have these parameters
             *
             * InputInterface  $input   An InputInterface instance
             * OutputInterface $output  An OutputInterface instance
             * Mixed           $payload Payload
             */
            $psubscriberCommand->{$method}($input, $output, $payload);
        });
    }
PSubscriberCommand