PHPackages                             glueful/queue-ops - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. glueful/queue-ops

ActiveGlueful-extension[Queues &amp; Workers](/categories/queues)

glueful/queue-ops
=================

Queue operations for Glueful (worker supervision, autoscaling, worker/job metrics).

v1.0.0(2d ago)00MITPHPPHP ^8.3

Since Jun 7Pushed 2d agoCompare

[ Source](https://github.com/glueful/queue-ops)[ Packagist](https://packagist.org/packages/glueful/queue-ops)[ Docs](https://github.com/glueful/queue-ops)[ RSS](/packages/glueful-queue-ops/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Queue Ops Extension for Glueful
===============================

[](#queue-ops-extension-for-glueful)

Overview
--------

[](#overview)

Queue Ops restores production-grade queue operations on top of the framework's lean queue runtime: supervised multi-worker fleets, intelligent autoscaling, and persisted worker/job metrics. The framework core ships a single-worker `queue:work`; this extension adds the supervisor and autoscaler around it.

It plugs into the framework through the `Glueful\Queue\Contracts\WorkerMonitorInterface` seam: the core binds a no-op `NullWorkerMonitor` by default, and this extension overrides it (last-provider-wins) with a persistence-backed `WorkerMonitor` that records worker lifecycle and job metrics into the `queue_workers` and `queue_job_metrics` tables. It then registers the process-supervision tree (`ProcessManager`, `AutoScaler`, `ScheduledScaler`, `ResourceMonitor`, `StreamingMonitor`) and the `queue:supervise` / `queue:autoscale`commands. Core's `queue:work` keeps running unchanged whether or not this extension is installed.

Features
--------

[](#features)

- **`queue:supervise`**: multi-worker supervision via Symfony Process — spawn, scale, stop, restart, status (with live watch), health checks, plus the leaf-worker IPC loop that spawned workers run
- **`queue:autoscale`**: resource-aware autoscaling daemon with load-based scaling, cron-scheduled scaling, resource monitoring, and real-time streaming
- **Worker &amp; job metrics persistence**: lifecycle, heartbeats, and per-job metrics recorded to `queue_workers` / `queue_job_metrics`
- **Resource-aware scaling**: CPU / memory / disk / load thresholds gate scale-up decisions to prevent resource exhaustion
- **Scheduled scaling**: cron-like schedules for predictable load windows (`dragonmantank/cron-expression`)
- **Seam-based**: binds the core `WorkerMonitorInterface`, overriding the no-op default; the framework's lean `queue:work` is unaffected

Installation
------------

[](#installation)

### Installation (Recommended)

[](#installation-recommended)

**Install via Composer**

```
composer require glueful/queue-ops

# Rebuild the extensions cache after adding new packages
php glueful extensions:cache
```

Composer discovers packages of type `glueful-extension`, but **installing does not auto-enable** them — the provider must be added to `config/extensions.php`'s `enabled` allow-list. The CLI does that for you:

```
# Enable (adds the provider FQCN to config/extensions.php + recompiles the cache)
php glueful extensions:enable queue-ops

# Disable (removes it)
php glueful extensions:disable queue-ops
```

In production, manage the `enabled` list in config and run `php glueful extensions:cache` in your deploy step.

This extension ships migrations (`queue_workers`, `queue_job_metrics`). Run them after enabling:

```
php glueful migrate:run
```

### Local Development Installation

[](#local-development-installation)

To develop the extension locally, register it as a Composer **path repository** in your app's `composer.json`, then require and enable it:

```
// composer.json
"repositories": [
    { "type": "path", "url": "extensions/queue-ops", "options": { "symlink": true } }
]
```

```
composer require glueful/queue-ops:@dev
php glueful extensions:enable queue-ops
php glueful migrate:run
```

Entries in `config/extensions.php` are plain string FQCNs (no `::class`) — prefer `extensions:enable` over editing by hand.

### Verify Installation

[](#verify-installation)

```
php glueful extensions:list
php glueful extensions:info queue-ops
php glueful extensions:diagnose
```

Post-install checklist:

- Run migrations (if not auto-run): `php glueful migrate:run`
- Rebuild cache after Composer operations: `php glueful extensions:cache`
- Confirm the seam is bound: resolving `Glueful\Queue\Contracts\WorkerMonitorInterface` yields `Glueful\Extensions\QueueOps\Monitoring\WorkerMonitor`

Configuration
-------------

[](#configuration)

Configuration is loaded from the extension's `config/queue_ops.php` and merged under the `queue_ops` key by the service provider. The keys below moved out of core `config/queue.php` (the `queue.workers.*` tree) when the ops surface became this extension; the feeding env vars are unchanged.

```
# Process management (Symfony Process)
QUEUE_PROCESS_ENABLED=true
QUEUE_DEFAULT_WORKERS=2
QUEUE_MAX_WORKERS_GLOBAL=50
QUEUE_MAX_WORKERS=10
QUEUE_RESTART_DELAY=5
QUEUE_HEALTH_CHECK_INTERVAL=30
QUEUE_WORKER_TIMEOUT=300
QUEUE_GRACEFUL_SHUTDOWN_TIMEOUT=30
QUEUE_HEARTBEAT_INTERVAL=15
QUEUE_MAX_RESTARTS_PER_HOUR=10

# Auto-scaling
QUEUE_AUTO_SCALING=false
QUEUE_SCALE_CHECK_INTERVAL=60
QUEUE_SCALE_UP_THRESHOLD=100
QUEUE_SCALE_DOWN_THRESHOLD=10
QUEUE_SCALE_UP_STEP=2
QUEUE_SCALE_DOWN_STEP=1
QUEUE_SCALE_COOLDOWN=300

# Resource limits & thresholds
QUEUE_WORKER_MEMORY_LIMIT=512M
QUEUE_WORKER_TIME_LIMIT=3600
QUEUE_JOB_TIMEOUT=300
QUEUE_MAX_JOBS_PER_WORKER=1000
QUEUE_MEMORY_WARNING=75
QUEUE_MEMORY_CRITICAL=90
QUEUE_CPU_WARNING=70
QUEUE_CPU_CRITICAL=90
QUEUE_LOAD_WARNING=2.0
QUEUE_LOAD_CRITICAL=4.0

# Legacy supervisor (prefer process management)
QUEUE_SUPERVISOR_ENABLED=false
QUEUE_SUPERVISOR_CONFIG=/etc/supervisor/conf.d/
```

The config exposes these blocks: `process`, `auto_scaling`, `queues` (per-queue `workers` / `max_workers` / `auto_scale`), `resource_limits`, `resource_thresholds`, and `supervisor`. Per-queue worker counts are set with env vars such as `CRITICAL_QUEUE_WORKERS` / `CRITICAL_QUEUE_MAX_WORKERS` / `CRITICAL_QUEUE_AUTO_SCALE`(and the equivalent `DEFAULT_*`, `HIGH_*`, `EMAIL_*`, `REPORTS_*`, `NOTIFICATIONS_*`, `MAINTENANCE_*` sets).

The per-queue **kept** keys — `priority` / `memory_limit` / `timeout` / `max_jobs` — remain in core `config/queue.workers.queues.` and are read by the core worker; this extension merges them with its own per-queue keys at runtime.

Usage
-----

[](#usage)

Core keeps a lean single-worker runner regardless of this extension:

```
php glueful queue:work            # core, single worker — always available
```

### Supervise a worker fleet — `queue:supervise`

[](#supervise-a-worker-fleet--queuesupervise)

```
# Start the default fleet (2 workers per queue, then monitor)
php glueful queue:supervise

# Actions: work | process | spawn | scale | status | stop | restart | health
php glueful queue:supervise spawn   --queue=high --count=3
php glueful queue:supervise scale   --queue=default --count=5
php glueful queue:supervise status  --watch=2          # live-refresh, or --json
php glueful queue:supervise health
php glueful queue:supervise stop    --all              # or --worker-id=ID
php glueful queue:supervise restart --all              # or --worker-id=ID
```

The `process` action is the leaf-worker IPC loop spawned workers run; it emits `[HEARTBEAT]` / `[JOB_COMPLETED]` / `[METRICS]` lines the supervisor parses (use `--with-monitoring` / `--emit-heartbeat`).

### Autoscale — `queue:autoscale`

[](#autoscale--queueautoscale)

```
# Run the autoscaling daemon (load + schedule + resource aware)
php glueful queue:autoscale                 # = run
php glueful queue:autoscale run --interval=30 --streaming
php glueful queue:autoscale run --no-resource-checks --no-scheduling

# Actions: run | status | config | schedule | resources | stream
php glueful queue:autoscale status   --detailed         # or --json
php glueful queue:autoscale config   --show             # --validate | --reload
php glueful queue:autoscale schedule --list             # or --preview --days=7
php glueful queue:autoscale resources --current         # --history | --trends
php glueful queue:autoscale stream   --format=table     # --filter=, --export=
```

Requirements
------------

[](#requirements)

- PHP 8.3 or higher
- Glueful 1.52.0 or higher
- `ext-pcntl` recommended (graceful signal handling for daemons/leaf workers)
- `symfony/process` and `dragonmantank/cron-expression` (provided by the framework)

License
-------

[](#license)

MIT — licensed consistently with the Glueful framework.

Support
-------

[](#support)

For issues, feature requests, or questions, please create an issue in the repository.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/95650726?v=4)[msowah](/maintainers/msowah)[@msowah](https://github.com/msowah)

---

Top Contributors

[![MichaelSowah](https://avatars.githubusercontent.com/u/24699905?v=4)](https://github.com/MichaelSowah "MichaelSowah (9 commits)")

---

Tags

queueoperationsworkersautoscalingglueful

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/glueful-queue-ops/health.svg)

```
[![Health](https://phpackages.com/badges/glueful-queue-ops/health.svg)](https://phpackages.com/packages/glueful-queue-ops)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k532.1M19.2k](/packages/laravel-framework)[spatie/laravel-health

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M195](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M506](/packages/shopware-core)[dereuromark/cakephp-queue

The Queue plugin for CakePHP provides deferred task execution.

309914.0k25](/packages/dereuromark-cakephp-queue)[orisai/scheduler

Cron job scheduler - with locks, parallelism and more

4041.4k5](/packages/orisai-scheduler)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
