Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to listen all queue in laravel?

laravel 5.4 + redis

If I use php artisan queue:listen , it will listen the default queue.
If I specify the queue by php artisan queue:listen --queue athen only the queue a will be listen.
Is there anyway to listen all queue in laravel 5.4 if there are many queues?

like image 996
chenxinlong Avatar asked May 06 '17 16:05

chenxinlong


People also ask

What does php artisan queue listen do?

queue:listen will listen to the queue, and continue to process any queue commands it receives. This will continue running indefinitely until you stop it. In Laravel >=4.2 there was a --daemon command added.

What is Dispatch in Laravel?

Dispatcher is a Laravel artisan command scheduling tool used to schedule artisan commands within your project so you don't need to touch the crontab. This sounds brilliant for shared hosts and on-premise apps.

What is queue listener in Laravel artisan queue?

Laravel Artisan Queue Command: The queue:listen Command The queue:listen command is used to listen for and process jobs as they are added to the job queue. The command defines numerous parameters and options that can be used to customize how the queue listener interacts with and behaves under...

How do I run a queue worker in Laravel?

The queue:workCommand Laravel includes an Artisan command that will start a queue worker and process new jobs as they are pushed onto the queue. You may run the worker using the queue:workArtisan command. Note that once the queue:workcommand has started, it will continue to run until it is manually stopped or you close your terminal:

How do I listen to events in Laravel?

Laravel's events provide a simple observer pattern implementation, allowing you to subscribe and listen for various events that occur within your application. Event classes are typically stored in the app/Events directory, while their listeners are stored in app/Listeners.

How to check the status of Laravel artisan commands?

By default, commands will be run using node interpreter. So, --interpreter will set it to php. Finally, 'queue:work --daemon' is the argument to the php artisan command. After running the above command from the laravel project root, run the following command to check the status.


1 Answers

I am afraid you cannot listen to all available queues without specifying which ones; you can, however, use the --queue parameter for multiple queues, e.g.,:

php artisan queue:listen --queue a,b,c
like image 83
Javier Arias Avatar answered Oct 06 '22 17:10

Javier Arias