addArgument( "number", InputArgument::REQUIRED, 'Number of shutdown messages to send to each targeted consumer queue.' ); $this->addArgument( "queue", InputArgument::OPTIONAL, 'A queue whose consumers are to shut down.' ); $this->addOption( 'label', 'l', InputOption::VALUE_OPTIONAL, 'Comma-separated consumer labels to shut down (see consume --label). Empty targets the shared DIE queue.' ); } protected function executeCommand(InputInterface $input, OutputInterface $output): int { // Stejné cílení jako reload-consumers (sdílená vs. label-specifická DIE fronta), liší se jen typem // řídicí zprávy: shutdown konzumera ukončí tak, aby ho supervisor už znovu nenastartoval (viz README). $labels = $input->getOption('label'); $labels = $labels ? explode(',', $labels) : [null]; $queue = $this->backgroundQueue->getQueue($input->getArgument("queue")); foreach ($labels as $label) { for ($i = 0; $i < $input->getArgument("number"); $i++) { $this->producer->publishShutdown($queue, $label); } } return self::SUCCESS; } }