robuust / laravel-heroku-queue-listener
Laravel package to autoscale Heroku queue workers based on queue events
Package info
github.com/robuust/laravel-heroku-queue-listener
pkg:composer/robuust/laravel-heroku-queue-listener
Requires
- php: ^8.2
- ext-pcntl: *
- illuminate/contracts: ^10.0|^11.0|^12.0|^13.0
- illuminate/events: ^10.0|^11.0|^12.0|^13.0
- illuminate/queue: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- php-heroku-client/php-heroku-client: ^4.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-23 08:28:22 UTC
README
Autoscale Heroku worker dynos based on Laravel queue events.
Installation
composer require robuust/laravel-heroku-queue-listener
The package uses Laravel package auto-discovery.
PCNTL is required for Laravel's queue:work daemon to handle POSIX signals and enforce job timeouts. Heroku's PHP buildpack enables extensions required by dependencies from the application's committed composer.lock on the next build.
If a shell script launches the worker, use exec php artisan queue:work as its final command to replace the shell with PHP. Heroku sends SIGTERM to all processes in a dyno; exec removes the extra shell process.
Configuration
Set the following environment variables:
HEROKU_API_KEYHEROKU_APP_NAME
Optional:
QUEUE_AUTOSCALER_RELEASE_EVENT(defaults toApp\\Events\\AppReleased)QUEUE_AUTOSCALER_CACHE_KEY(defaults toqueue-autoscaler:current-dynos)QUEUE_AUTOSCALER_CACHE_TTL_SECONDS(defaults to3600)
Publish config if needed:
php artisan vendor:publish --tag=queue-autoscaler-config