phplaravelasynchronouslaravel-jobs

Difference between parameters passed at queue:work and config/queue.php in Laravel


In Laravel, what is the difference between parameters passed at queue:work and config/queue.php

Both have similar parameters and are used to specify parameters like timeout, etc for the jobs in queue

Then where lies the difference, is it that , the priority of parameters will be different ?


Solution

  • queue:work is artisan command to run the worker. Laravel includes a queue worker that will process new jobs as they are pushed onto the queue. Once the queue:work command has started, it will continue to run until it is manually stopped or you close your terminal. For more info:https://laravel.com/docs/8.x/queues#running-the-queue-worker

    config/queue.php is a file in which the queue configuration file is stored. In this file you will find connection configurations for each of the queue drivers that are included with the framework, which includes a database, Beanstalkd, Amazon SQS, Redis, and a synchronous driver that will execute jobs immediately (for local use). For more info: https://laravel.com/docs/8.x/queues