yuntian001/multi-process-queue
A Laravel/PHP package for multi-process queue processing. It runs queue workers in parallel to improve job throughput and makes it easier to manage concurrent queue consumption in Laravel applications, helping background jobs scale beyond a single worker process.
Requirements to verify before anything else: the Swoole PHP extension (php --ri swoole), a supported PHP version, and a reachable Redis connection if the package uses Redis as its backing store. Because the package relies on Swoole's process and coroutine primitives, it will not run on typical shared hosting where proc_open is disabled or Swoole can't be installed — plan for a VPS/container where you control the PHP build.
Steps:
composer require yuntian001/multi-process-queue and pin the resolved version in composer.json (last tag is from January 2023, so pin exactly rather than floating).config/app.php.php artisan vendor:publish --provider="Yuntian001\MultiProcessQueue\...") — verify the exact provider namespace from the README, it's the fastest way to see worker count, timeout, retry, and broker settings in one place.handle() method that receives the payload). Keep the constructor small — it's what gets serialized.queue:work style; confirm the exact signature in the README before scripting it into Supervisor).Where to look first: the published config file (it tells you the real defaults faster than the README), then the package's console command class, then the README's minimal example. With 93 stars the documentation is likely terse, so read the source for anything ambiguous.
Producer side. Dispatch from controllers, model observers, and scheduled commands the same way you'd dispatch a Laravel job — but keep payloads scalar and small. Serialize an ID or a small DTO, not an Eloquent model, so retries don't rehydrate stale state.
Job design. Treat each job as idempotent. Because timeout control and retry are built in, a job can be re-executed after a partial success; use a dedupe key or a status column so repeated runs are safe. Put retry/timeout tuning as job-level properties (or per-job config entries) rather than editing global worker config for a single slow job.
Worker topology. Size worker_num to your measured job latency and target throughput, not to the machine's core count. Enable coroutine mode for IO-bound jobs (HTTP, Redis, DB) so a single worker can multiplex; keep CPU-bound jobs in a separate worker pool or accept that they will block the event loop.
Framework integration. The package is designed to coexist with Laravel's native queue. A pragmatic migration pattern is: new work goes onto multi-process-queue, existing work stays on the database/Redis driver, and you retire the native queue once failure handling and monitoring have proven themselves. Register a Supervisor program (or systemd unit) so the worker restarts automatically; wire SIGTERM/reload into your deploy script so workers pick up new code.
Observability. Add structured logging inside handle() with a job ID in the context, and surface failures to the same channel your Laravel queue uses. Without this, a 93-star package with a sparse UI leaves you debugging from ps and log tails.
Testing. Don't spin up a real worker in tests. Call handle() directly with a fixture payload, or expose a synchronous dispatch path behind an interface so tests and local dev don't require Swoole.
file_get_contents call will stall the whole worker. Use coroutine-safe Redis/MySQL clients where available, and benchmark under concurrency rather than trusting the "supports coroutines" line.QUEUE_CONNECTION.php artisan config:cache is easy to forget after changing worker_num or timeout; the running worker won't see edits until you rebuild and restart.SIGTERM; a hard kill during a retry-heavy job leaves ambiguous state in whatever the job was mutating.How can I help you explore Laravel packages today?