Download the PHP package randika-srimal/queue-manager without Composer
On this page you can find all versions of the php package randika-srimal/queue-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download randika-srimal/queue-manager
More information about randika-srimal/queue-manager
Files in randika-srimal/queue-manager
Package queue-manager
Short Description A Laravel package to manage multiple queue workers similar to Horizon, with memory monitoring and graceful shutdown
License MIT
Informations about the package queue-manager
Laravel Queue Manager
A Laravel package to manage multiple queue workers similar to Horizon, with memory monitoring and graceful shutdown capabilities. This package allows you to run multiple queue workers with different configurations from a single command.
Features
- 🚀 Multiple Worker Processes - Spawn multiple workers with different configurations
- 🧠 Memory Monitoring - Automatically restart workers that exceed memory limits
- 🔄 Auto-Restart - Workers are restarted when they crash or terminate
- 🛑 Graceful Shutdown - Properly handles SIGTERM, SIGINT (Ctrl+C), and SIGHUP signals
- ⚙️ Configurable - Easy configuration file for all worker settings
- 📊 Process Monitoring - Real-time display of worker status and PIDs
Requirements
- PHP 8.1 or higher
- Laravel 10.x or 11.x
- PCNTL extension (for signal handling)
Installation
Install the package via Composer:
For Local Development
If you're developing this package locally, add it to your Laravel project's composer.json:
Then run:
Configuration
Publish the configuration file:
This will create config/queue-manager.php in your Laravel project. Edit this file to configure your workers:
Usage
Start the queue manager:
Options
--no-restart- Disable automatic restart of failed workers
Stopping the Queue Manager
Press Ctrl+C to gracefully shutdown all workers. The manager will:
- Send SIGTERM to all worker processes
- Wait up to 10 seconds for workers to finish current jobs
- Force kill any remaining processes
How It Works
- Worker Spawning - The command reads the configuration and spawns the specified number of worker processes for each queue configuration
- Process Monitoring - Continuously monitors all worker processes
- Memory Checking - Periodically checks memory usage and restarts workers exceeding limits
- Auto-Restart - Automatically restarts workers that crash or terminate unexpectedly
- Signal Handling - Catches shutdown signals and gracefully terminates all child processes
Example Configuration
Database Queue with Email Workers
Redis Queue with Priority
Process Supervisor
For production environments, it's recommended to run the queue manager under a process supervisor like systemd or Supervisor.
Systemd Example
Create /etc/systemd/system/queue-manager.service:
Enable and start:
Supervisor Example
Create /etc/supervisor/conf.d/queue-manager.conf:
Update and start:
License
The MIT License (MIT). Please see License File for more information.
Credits
Inspired by Laravel Horizon's process management capabilities.
All versions of queue-manager with dependencies
illuminate/console Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
symfony/process Version ^6.0|^7.0