I’ve recently implemented Laravel Queue processing in Acorn and have questions for others using it.
Queues need to be restarted when there are code changes to Queue Jobs. Laravel supports this command: php artisan queue:restart, but there is no Acorn equivalent. Do we just use the native artisan command from the vendor directory instead? It would be great to add this to our deployment process, and it would be great if queue:restart was added to the list of supported acorn commands.
In production environments, to keep the queue worker running permanently, Laravel advises using Supervisor like this: command=php /home/forge/app.com/artisan queue:work --sleep=3 --tries=3 --max-time=3600 Is there an Acorn equivalent for this? I’m not finding the correct path, which I assume is in the vendor directory somewhere.
Is there any functional difference between wp acorn queue:work and php artisan queue:work? Or are the WP-CLI acorn commands just a convenience wrapper for php artisan commands?
3. Functional difference between wp acorn and php artisan
There is no functional difference. Both wp acorn and bin/acorn use the exact same Acorn Console Kernel. They’re the same application booted through a different entry point. The only difference is how input is handled (wp acorn receives args from WP-CLI, bin/acorn reads directly from the command line). They produce identical results.
Note: php artisan itself won’t work in an Acorn context since there’s no artisan binary, so use wp acorn or bin/acorn instead.