Search by

webong / propane

webong

Workerman and RoadRunner for Laravel HTTP and queue workers.

Package info

github.com/webong/propane

pkg:composer/webong/propane

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-11-30 15:13 UTC

This package is auto-updated.

Last update: 2026-11-30 15:18:00 UTC


README

Propane runs Laravel HTTP and queue workers on Workerman or RoadRunner. Use Laravel's queue:work for jobs, add Horizon for supervisor controls, or add Octane to serve HTTP with octane:start. Propane generates the RoadRunner configuration when each process starts.

Install

Propane requires Laravel 13 and PHP 8.3 or newer with pcntl and posix on Linux or macOS. Install the development version with Composer.

composer require webong/propane:dev-main

To use a local checkout during development, configure a Composer path repository.

composer config repositories.propane path /path/to/propane
composer require webong/propane:@dev

Propane installs without a worker runtime. Add the packages for the drivers you use. Propane extends the commands from Octane and Horizon when the app installs those packages. RoadRunner also needs an rr binary in the app directory or on PATH.

Run HTTP with Octane

For Workerman HTTP, install Octane and Workerman.

composer require laravel/octane:^2.26 workerman/workerman:^5.2

For RoadRunner HTTP, install Octane and the RoadRunner PHP HTTP worker.

composer require laravel/octane:^2.26 roadrunner/http:^4.2

Set OCTANE_SERVER=workerman or OCTANE_SERVER=roadrunner. Use Octane settings and command options to set the host, port, worker count, and request limits. Set roadrunner.binary in config/octane.php to choose the RoadRunner executable. Use roadrunner.http for RoadRunner-specific HTTP options such as middleware, static files, or RPC.

php artisan octane:start
php artisan octane:status
php artisan octane:reload
php artisan octane:stop

octane:start runs in the foreground. octane:reload reloads the workers using the active configuration. The Workerman adapter buffers responses, including streamed responses and file downloads. Use a reverse proxy for Workerman TLS and static assets.

If you supply a custom RoadRunner worker via octane.roadrunner.command, octane:reload needs roadrunner/goridge for RPC. roadrunner/http normally installs it through its dependencies.

Run Laravel queues with Workerman

Install Workerman to run Laravel queue workers under Workerman.

composer require workerman/workerman:^5.2

Start a worker with queue:work

Add 'runner' => 'workerman' to an existing queue connection in config/queue.php. Keep that connection's Laravel driver, such as redis or database. Dispatch jobs to the connection as usual.

'redis' => [
    'driver' => 'redis',
    'runner' => 'workerman',
    // Keep the existing Redis connection and queue settings.
],
php artisan queue:work redis --queue=mail,default --tries=3 --backoff=5
php artisan queue:work redis --once

Each command starts one foreground Workerman worker and exits when Laravel's worker exits. Laravel handles queue options, job events, retries, timeouts, and exit limits such as --max-jobs and --stop-when-empty. Horizon is optional.

Start a worker pool with horizon

Install laravel/horizon to use supervisor settings and management commands.

composer require laravel/horizon:^5.0

Horizon uses Workerman when the default queue connection selects it. To choose Workerman for Horizon explicitly, set runner in config/horizon.php alongside your supervisor settings.

return [
    'runner' => env('HORIZON_RUNNER'),
];
HORIZON_RUNNER=workerman
QUEUE_CONNECTION=redis

Workerman starts a fixed number of workers for each Horizon supervisor using maxProcesses and that supervisor's connection and queue settings. The pool uses Laravel's worker for job execution, retries, failed-job logging, and recycling. Workerman honors tries, backoff, timeout, memory, maxJobs, maxTime, sleep, rest, and force.

php artisan horizon
php artisan horizon:status
php artisan horizon:pause
php artisan horizon:continue
php artisan horizon:terminate --wait

Pause and continue apply to this Workerman runner. Termination lets running jobs finish. Workerman polls Redis according to the supervisor's sleep setting, which defaults to one second, so an idle worker can respond to lifecycle commands.

Run RoadRunner Jobs

Install the RoadRunner Jobs package in each app that dispatches or consumes jobs.

composer require roadrunner/jobs:^4.9

For local development, set these values in .env and add the connection to config/queue.php.

APP_ENV=local
QUEUE_CONNECTION=roadrunner
'roadrunner' => [
    'driver' => 'roadrunner',
    'queue' => env('RR_QUEUE', 'default'),
    'binary' => env('RR_BINARY'),
    'lifecycle' => env('RR_QUEUE_LIFECYCLE', 'queue'),
    'after_commit' => false,
],

Both queue commands use roadrunner/jobs for delivery and Laravel's worker for job execution, events, retries, and timeouts. The connection's lifecycle setting controls how the app is prepared for each job.

In local and testing, missing pipelines default to the in-memory driver. To use a broker, add a pipelines entry for each queue with RoadRunner's driver and config options. Other environments require explicit pipeline configuration. The optional rpc value defaults to tcp://127.0.0.1:6002. Use the same address for the producer apps and the consumer process. Optional connection settings also include binary, logs, and endure. RoadRunner pipeline configuration

Implement Webong\Propane\Queue\HasQueueOptions to set RoadRunner publish options on an individual job.

Choose a queue lifecycle

Lifecycle Use it when Tradeoff
queue (default) You want Laravel's standard queue worker lifecycle. Boots the console kernel and clears scoped bindings between jobs.
octane Your jobs benefit from Octane's per-task sandbox or listeners such as TaskReceived and TaskTerminated. The upstream Laravel bridge loads Octane. Each job runs in a cloned application container and triggers Octane's task listeners.

To use the Octane lifecycle, install the bridge and set RR_QUEUE_LIFECYCLE=octane in .env. The bridge also installs roadrunner/jobs.

composer require roadrunner-php/laravel-bridge:^6.8

The setting applies to both queue:work and horizon for the selected connection. You can run either lifecycle alongside an HTTP or gRPC process.

Start a worker with queue:work

php artisan queue:work roadrunner --queue=mail,default --tries=3 --backoff=5
php artisan queue:work roadrunner --once
php artisan queue:work roadrunner --stop-when-empty-for=10

You can omit the connection name when RoadRunner is the default queue connection. Propane starts rr in the foreground with one PHP worker. --queue selects RoadRunner pipelines, and their configured priorities determine delivery order. Connections without a Propane runner use Laravel's native queue:work.

  • --tries, --backoff, --timeout, --force, --memory, and --rest apply to the Laravel worker. Job-specific retry and timeout settings take precedence. --json writes Laravel job events to stdout and sends RoadRunner logs to stderr.
  • --once, --max-jobs, and --max-time stop the command. The job limit counts attempts, including retries. The time limit lets an active attempt finish.
  • --stop-when-empty and, where available in Laravel, --stop-when-empty-for use the broker counts reported by RoadRunner. The accuracy of these counts depends on the pipeline driver. --sleep controls the empty wait and idle checks. Delayed jobs can become available after these commands exit. Use a persistent broker to keep jobs across RoadRunner restarts.

Start a worker pool with horizon

Install laravel/horizon in the app to use these commands with RoadRunner Jobs.

php artisan horizon
php artisan horizon:status
php artisan horizon:pause
php artisan horizon:continue
php artisan horizon:terminate --wait

Where config/horizon.php is present, Propane reads the queue and maxProcesses values from supervisors on the selected connection, including overrides for the current environment. Those queues share a fixed RoadRunner worker pool. Without a matching supervisor, the default queue gets one worker. An app that installs Laravel Horizon can use its native supervisor for Redis.

Choose one startup command per Laravel app. When RoadRunner Jobs is the selected Horizon runner, its status, pause, continue, and terminate commands can also manage the process started by queue:work.

Pause and continue control the consumed pipelines. Dispatching to a paused pipeline through Propane leaves it paused. The Laravel queue connection's shutdown_timeout controls how long horizon:terminate --wait waits, with a default of 60 seconds. Allow more time than RoadRunner's endure.grace_period.

Generated configuration

Propane writes separate .rr.yaml files under storage/framework/propane/roadrunner-http and storage/framework/propane/roadrunner-jobs. These files are replaced on startup. After changing Laravel configuration, rebuild the Laravel config cache if you use one and restart the affected process.

Queue visibility

With Horizon installed, run php artisan horizon:status to see the queues and their runner status. Read pending, delayed, and reserved counts through Laravel's queue connections. Workerman uses the Redis or database connection directly. The RoadRunner connection reads pipeline counts from the Jobs API.

Install laravel/horizon in the app to use Laravel's Redis dashboard. Its job history can include jobs processed by Workerman through Horizon's Redis connection. Use Propane's Artisan commands to check the Workerman supervisor. Laravel Horizon documentation

Verify

composer install
PROPANE_TEST_RR=/path/to/rr PROPANE_TEST_REDIS_PORT=6379 composer test

The tests boot isolated Laravel apps. They cover request isolation, queue dispatch, worker recycling, retry, and graceful shutdown. Setting PROPANE_TEST_RR enables RoadRunner integration tests. Setting PROPANE_TEST_REDIS_PORT with phpredis enabled adds the Redis queue test against a local Redis instance.