0 follower

Final Class Yiisoft\Queue\Command\ListenCommand

InheritanceYiisoft\Queue\Command\ListenCommand » Symfony\Component\Console\Command\Command

Protected Methods

Hide inherited methods

Method Description Defined By
execute() Yiisoft\Queue\Command\ListenCommand

Method Details

Hide inherited methods

__construct() public method

public __construct( Yiisoft\Queue\Provider\QueueProviderInterface $queueProvider ): mixed
$queueProvider Yiisoft\Queue\Provider\QueueProviderInterface

                public function __construct(
    private readonly QueueProviderInterface $queueProvider,
) {
    parent::__construct();
}

            
configure() public method

public configure( ): void

                public function configure(): void
{
    $this->addArgument(
        'channel',
        InputArgument::OPTIONAL,
        'Queue channel name to connect to',
        QueueProviderInterface::DEFAULT_CHANNEL,
    );
}

            
execute() protected method

protected execute( \Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output ): integer
$input \Symfony\Component\Console\Input\InputInterface
$output \Symfony\Component\Console\Output\OutputInterface

                protected function execute(InputInterface $input, OutputInterface $output): int
{
    $this->queueProvider
        ->get($input->getArgument('channel'))
        ->listen();
    return 0;
}