Ride: Queue CLI
This module adds various queue commands to the Ride CLI., (*1)
Commands
queue status
This command retrieve the status of the queue system, a queue or a job., (*2)
Syntax: queue status [<queue> [<job>]]
- <queue>: Name of the queue
- <job>: Id of the job, (*3)
Alias: qs, (*4)
queue worker
This command runs a worker for a queue., (*5)
The worker will poll the queue for jobs and invoke those retrieved jobs when available., (*6)
Syntax: queue worker [<queue> [<sleep>]]
- <queue> Name of the queue
- <sleep>: Time in seconds between polling for jobs, (*7)
Alias : qw, (*8)
Note: use the sleep function of the operating system in a live environment. This way your worker is restarted regulary to load new code and configuration. See the next topic about worker.sh., (*9)
Worker.sh
In the src directory, you will find a script called worker.sh.
This script is a wrapper around the queue worker command.
It runs as an infinite loop so when your worker crashes due to bugger jobs or whatever, it will restart and continue to work., (*10)
You can copy this script to your application directory to set it up for your project.
Use this script for a @reboot cron job to make sure the worker is always running, even when the server restarts., (*11)
# Crontab
@reboot /path/to/ride/application/worker.sh
Installation
You can use Composer to install this application., (*12)
composer require ride/cli-queue