You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
#[AsCommand(name: 'background-queue:reload-consumers', description: 'Creates the specified number of noop messages to reload consumers consuming specified queue.')]
class ReloadConsumersCommand extends Command
{
public function __construct(private readonly BackgroundQueue $backgroundQueue, private readonly Producer $producer)
{
parent::__construct();
}
protected function configure(): void
{
$this->addArgument(
"number",
InputArgument::REQUIRED,
'Number of consumers to reload.'
);
$this->addArgument(
"queue",
InputArgument::OPTIONAL,
'A queue whose consumers are to reload.'
);
}
protected function executeCommand(InputInterface $input, OutputInterface $output): int
{
for ($i = 0; $i < $input->getArgument("number"); $i++) {