Dealing with Laravel queue, what I understand is job is the task that is kept in the queue to be performed one after another.
The Laravel doc says :
In other words, if you dispatch a job without explicitly defining which queue it should be dispatched to, the job will be placed on the queue that is defined in the queue attribute of the connection configuration:
// This job is sent to the default queue...
Job::dispatch();
// This job is sent to the "emails" queue...
Job::dispatch()->onQueue('emails');
In another place in the same doc page, I find:
ProcessPodcast::dispatch($podcast);
ProcessPodcast
is a job here which is being dispatched with an argument i.e. $podcast
. But nowhere in the doc I found the syntax Job::
except in the mentioned 2 lines.
Q1) So where and how to use the syntax Job::
?
Every element in the connections
array inside config/queue.php
has 'queue' => 'default',
.
Q2) Where does the emails
queue come from in Job::dispatch()->onQueue('emails');
?