Workers
A worker pops payloads, restores jobs, runs middleware + handle(), and either acks success, releases for retry, or logs a failed job.
./grind queue:work./grind queue:work --connection=redis --queue=default./grind queue:work --once./grind queue:work --stop-when-empty --max=100./grind queue:work --daemon --sleep=3| Flag | Meaning |
|---|---|
--connection= |
Queue connection name |
--queue= |
Queue name on that connection |
--max= |
Stop after N successful process attempts |
--once |
Process at most one job |
--stop-when-empty |
Exit when the queue has no available jobs (default unless --daemon / --sleep) |
--daemon |
Keep polling when empty |
--sleep= |
Seconds to sleep when empty in daemon mode |
--timeout= |
Per-job timeout in seconds (0 disables) |
--memory= |
Stop if used heap reaches this many MB (0 disables) |
--tries= |
Override job try count |
--backoff= |
Override backoff seconds on retry |
Programmatically:
Worker( manager, connectionName = "array", queueName = "default", options = WorkerOptions(once = true, timeoutSeconds = 30),).run()Boot the app with ./grind steam and call Bus / Worker while developing. Prefer a dedicated queue:work process for real workloads.
Retries
Section titled “Retries”On exception, if attempts remain below tries, the worker releases the payload with backoffSeconds (via availableAt). Otherwise the failure is recorded — see Failed jobs.