Download the PHP package balkar/laravel-priority-queue-manager without Composer
On this page you can find all versions of the php package balkar/laravel-priority-queue-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-priority-queue-manager
Laravel Priority Queue Manager
A Laravel package that standardises priority queue dispatching across your team — with a clean Facade API, a shared config file, and a built-in artisan command to monitor queue health.
Why This Exists
Laravel already supports named queues. You can do this:
That works fine for a solo developer. In a team it breaks down:
- One dev writes
'high', another writes'urgent', another forgets->onQueue()entirely and it silently hits the default queue - No shared definition of what priority levels exist or what they mean
- No way to check queue depth per priority without writing a raw DB query
- Retry config and worker counts live in Supervisor files, deployment scripts, or someone's head
This package fixes all of that with a shared standard your whole team uses.
What It Does
Consistent dispatch API:
One config file for the whole team:
Queue health at a glance:
+----------+-------------+-----------+-------------+--------+
| Priority | Queued Jobs | Max Tries | Retry After | Status |
+----------+-------------+-----------+-------------+--------+
| CRITICAL | 0 | 5 | 30s | IDLE |
| HIGH | 4 | 4 | 60s | ACTIVE |
| NORMAL | 23 | 3 | 90s | ACTIVE |
| LOW | 150 | 2 | 300s | BUSY |
+----------+-------------+-----------+-------------+--------+
Requirements
| Laravel | PHP |
|---|---|
| 10.x | 8.2+ |
| 11.x | 8.2+ |
| 12.x | 8.2+ |
| 13.x | 8.3+ |
Installation
Publish the config:
Configuration
config/priority-queue.php after publishing:
retry_after is in seconds. tries is the maximum number of attempts before a job fails.
Usage
Dispatching jobs
Under the hood this calls Laravel's native dispatch($job)->onQueue($priority) — no magic, just a consistent API on top of what Laravel already does.
Running workers
Start a single worker that respects priority order:
Laravel processes critical first. Only when it is empty does it move to high, and so on.
Production worker management
Use Supervisor to keep workers running. Example config:
Supervisor is one option — you can also use systemd, Docker, or your platform's native process manager. The package has no dependency on any specific process manager.
Monitoring
+----------+-------------+-----------+-------------+--------+
| Priority | Queued Jobs | Max Tries | Retry After | Status |
+----------+-------------+-----------+-------------+--------+
| CRITICAL | 0 | 5 | 30s | IDLE |
| HIGH | 4 | 4 | 60s | ACTIVE |
| NORMAL | 23 | 3 | 90s | ACTIVE |
| LOW | 150 | 2 | 300s | BUSY |
+----------+-------------+-----------+-------------+--------+
Status is based on current job count in the database queue table:
IDLE— 0 jobsACTIVE— 1 to 10 jobsBUSY— more than 10 jobs
This command reads from the jobs table and works with the database queue driver out of the box. For Redis, SQS, or other drivers the count will show 0 — driver-specific monitoring support is on the roadmap.
Known Limitations
Starvation — strict priority ordering means low priority jobs can wait indefinitely if critical and high queues stay full. The monitoring command gives you visibility into this. Configurable max wait time with automatic job promotion is planned for v1.1.
Driver support — queue:priority-status job counts currently only work with the database driver.
No automatic worker management — the package standardises dispatch and config. Starting and managing worker processes is your responsibility via Supervisor, systemd, or your deployment setup.
Real World Context
At my previous company we built a student grade calculation engine that processed recursive async jobs across thousands of students. When teachers triggered bulk mark updates, thousands of recalculation jobs would fill the queue and block time-sensitive jobs like OTP delivery.
The fix was named queues with strict priority ordering — this package came out of making that pattern reusable and consistent across the team.
Roadmap
- [ ] Anti-starvation: configurable max wait time with automatic job promotion
- [ ] Redis and SQS driver support for queue:priority-status
- [ ] Lumen support
- [ ] Prometheus metrics export
Testing
Changelog
Please see CHANGELOG.md for recent changes.
Contributing
Pull requests are welcome. For major changes please open an issue first to discuss what you would like to change.
License
MIT. Please see LICENSE for more information.
Author
Balkar Singh
All versions of laravel-priority-queue-manager with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/queue Version ^10.0|^11.0|^12.0|^13.0