Wednesday, March 29, 2017

How to run Laravel queued jobs automatically

In Laravel, Jobs are Queued to run in order, or in the background, at a later time. I use this for processor intensive tasks like audio conversion, which the user doesn't necessarily have to sit around and wait for each time they upload a file.

Queued jobs are run with the command php artisan queue:listen - but is there a way to run the queue from php code, or set each job to run instantly?

If the server is restarted and the command php artisan queue:listen is not run, jobs can build up and never be run - it would be nice to have control within the application.

Laravel docs hint that 'Queue::' can be used to control certain queue commands https://laravel.com/docs/5.1/queues#supervisor-configuration



via Leon

Advertisement