michel/pqueue-bundle
A priority queue bundle for Laravel/PHP that lets you push jobs with weighted priorities and process the most important work first. Includes queue driver integration, configurable priority levels, and simple APIs for scheduling and managing background tasks.
This is a Symfony bundle, not a Laravel package — there is no ServiceProvider, no config/pqueue.php, no Laravel queue driver. If you're working in a Laravel codebase, the realistic first move is to treat the worker as a sidecar process (or use michel/pqueue directly and write a thin service provider), rather than expecting php artisan queue:work parity.
Minimal path:
composer require the bundle and register it in config/bundles.php.config/packages/pqueue.yaml first — this is the entire surface area of the release. The default transport is Filesystem, so you can dispatch and consume jobs on a single machine with zero infrastructure. Start there before reaching for a broker.sources for the directory, classes for explicit entries).Dispatcher service wherever you enqueue work, and dispatch a trivial job.bin/console pqueue:worker:run and confirm the job is consumed. Run with --help first — the option list (memory/time limits) is the most useful documentation you have in an alpha.First use case: local development and single-host background processing — image resizing, PDF generation, outbound webhooks — where a Filesystem transport is genuinely sufficient and you don't want Redis in the stack yet.
Config-driven handler registration. The bundle discovers handlers from sources and classes rather than service tags. This is low-friction but means your services.yaml tells you nothing about what's wired — pqueue.yaml becomes the source of truth. Keep the sources directory aligned 1:1 with your autoload namespaces so discovery doesn't drift.
Inject, don't locate. Dispatcher and Consumer are ordinary DI services. Constructor-inject Dispatcher into controllers, console commands, and domain services. Because it's injected, you can swap the underlying transport per environment (Filesystem in test, something durable in prod) without touching call sites.
Supervised long-running worker. Don't run pqueue:worker:run in a terminal and forget it. Set --memory-limit and --time-limit deliberately — the time limit is what lets a supervisor restart the process on a schedule, which is your main defense against memory leaks in an alpha-quality worker. Use supervisor/systemd/container restart policies, and restart workers on every deploy.
Filesystem-as-a-bus for a sidecar. In a Laravel app, the practical integration is a dedicated worker container or supervisor program sharing the queue directory with the app via a volume, with Laravel dispatching through a small adapter service. It's unglamorous but it isolates the Symfony dependency cleanly.
Scale out, not up. Multiple worker processes against the same Filesystem transport is the intended concurrency story on a single host. Beyond one host you need a different transport.
0.0.1-alpha means exactly that. Config keys, the config tree shape, and the command's option names can all change. Pin the exact version in composer.json and avoid exposing the bundle's classes in your own public API.sources produces a worker that starts cleanly and processes nothing. Verify with bin/console debug:container that Consumer actually received your handlers, and log loudly on unhandled messages.pqueue.yaml, run bin/console cache:clear. A stale container is a very common "my config change did nothing" report.Dispatcher and Consumer are plain services, so decorating them (logging, metrics, tracing) is cheaper than forking the bundle — and decorating survives minor version bumps better than subclassing.How can I help you explore Laravel packages today?