Final Class Yiisoft\Queue\Command\ListenCommand
| Inheritance | Yiisoft\ |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| configure() | Yiisoft\ |
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| execute() | Yiisoft\ |
Method Details
| public mixed __construct ( Yiisoft\ | ||
| $queueProvider | Yiisoft\ |
|
public function __construct(
private readonly QueueConsumerProviderInterface $queueProvider,
) {
parent::__construct();
}
| public void configure ( ) |
public function configure(): void
{
$this->addArgument(
'queue',
InputArgument::OPTIONAL,
'Queue name to connect to',
DefaultQueue::NAME,
);
}
| protected integer execute ( \ | ||
| $input | \ |
|
| $output | \ |
|
protected function execute(InputInterface $input, OutputInterface $output): int
{
$queueName = (string) $input->getArgument('queue');
$this->queueProvider->getConsumer($queueName)->listen();
return Command::SUCCESS;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.