Rohit Shirke
Jul 12, 2022

Hi Krixnaa,

Thank you for your question.

The command, queue:work --queue="queue_name"

basically defines a queue with a name,

and it tells the framework that there exist a process (queue) named "queue_name". So, when you programmatically dispatch a Job, it lands up in that queue.

The syntax [program:name_of_worker] is a configuration option associated with supervisor configuration and not related to Laravel. As you must be knowing the supervisor is a general purpose utility program that can be used to run any other program in the Deamon mode and we can have many such ones configured at a time. Hence this config file option allows us to have a logical separation.

That all may sound too much but the simple answer is,

"Both have different meanings and uses and both need to be specified at their respective locations."

I hope that helps!

Rohit Shirke
Rohit Shirke

Written by Rohit Shirke

Tech enthusiastic | Tech Lover | Software Developer

No responses yet