cboxdk/laravel-queue-autoscale
Laravel Queue Autoscale automatically adjusts the number of queue workers to match your workload, scaling up when queues back up and down when they're idle so jobs keep processing promptly while you avoid paying for idle workers.
This release is a bug-fix/minor release; if you already run the package, start by upgrading and restarting every long-running queue:autoscale process. There are no config changes.
First steps for a new or upgraded install:
php artisan queue:autoscale:doctor
Pay particular attention to any custom queue connections. As of v4.6.1, subclasses of SqsQueue now receive the SQS-specific doctor checks (dotted queue names, missing SLA signal) that were previously skipped.php artisan queue:autoscale --queue=default
use Support\QueueDriver;
QueueDriver::of('my-custom-connection'); // built-in driver it behaves as
The first practical use case is a custom queue driver that wraps a built-in one. If you have registered Queue::extend('my-redis', ...) returning a RedisQueue subclass, this release makes the autoscaler, cluster summary and console treat it as Redis rather than as an unknown driver.
Register custom drivers normally with Queue::extend(). The package resolves the connection once per process and inspects the underlying queue object:
Queue::extend('tenant-redis', function () {
return new TenantRedisQueue(config('queue.connections.tenant-redis'));
});
If TenantRedisQueue extends RedisQueue, it now gets Redis behaviour everywhere: engine, cluster summary and console. A subclass of SqsQueue gets the SQS doctor checks. A subclass of BackgroundQueue, SyncQueue, DeferredQueue or NullQueue is treated as a workable queue.
Prefer extending a built-in queue over implementing Queue from scratch. The package only understands built-ins it can recognise. A driver that extends no built-in queue is judged by its driver name, exactly as before, which means the autoscaler may not know how to report oldest job age or may treat a recovered queue as breached.
Use QueueDriver::of() as an extension/diagnostic point. It is useful in your own health checks, tests, or operational commands where you need to know how the package will classify a connection without duplicating the subclass-detection logic.
Watch for SQS subclass behaviour changes. If you previously subclassed SqsQueue and relied on the doctor not running SQS checks, those checks now run. Dotted queue names and the SLA signal become relevant, so make sure your subclass exposes the same SQS semantics the package expects.
Restart is part of the deployment pattern. Because the resolved instance is cached for the lifetime of the autoscale process, treat queue:autoscale like a queue worker: restart it after every deploy that changes queue drivers or upgrades this package.
queue:autoscale after upgrading. The manager now holds one resolved instance of each custom connection for the process lifetime. A process started before the upgrade will not pick up the new classification.redis, database, sqs, sync, etc. The new resolution path only affects connections on custom driver names.BackgroundQueue, SyncQueue, DeferredQueue or NullQueue is now workable. Do not extend these as a base for a custom asynchronous driver unless you want the package to treat jobs as runnable by a worker.Queue directly rather than extending a built-in, the package will not infer capabilities. Either extend the closest built-in queue or accept the pre-existing driver-name fallback.queue:autoscale:doctor for SQS subclasses. Checks that were previously skipped because the driver name was unrecognised now execute. A failing check after upgrade is a real configuration finding, not a regression.SqsQueue subclasses; verify the queue name format and that your metrics source supplies the SLA signal.cboxdk/laravel-queue-metrics 3.5.1 change is test-only. No runtime action is needed for that part of the release.Support\QueueDriver::of() is the supported extension point for classification; avoid reimplementing subclass checks in your own code, as the package's list of recognised built-ins may evolve.How can I help you explore Laravel packages today?