serializer = $serializer; $this->messageProcessor = $processor; $this->bsTubeName = $bsTubeName; parent::__construct(); } /** {@inheritdoc} */ protected function configure() { $this ->setName('point:update:websocket-messages') ->setDescription('Reads and processes updates from Beanstalkd queue pipe') ; } /** {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { foreach ($updates as $update) { $message = $this->serializer->deserialize($update, Message::class, 'json'); if ($this->messageProcessor->processMessage($message)) { // BS delete item } else { // BS return to queue } } } }