liberusoftware/scheduler-queues
Run Laravel scheduled tasks through queues instead of executing them inline. This package integrates the scheduler with your queue system for better reliability, control, and performance.
Treat liberusoftware/scheduler-queues as a convention layer for making queued jobs safe to retry, safe to overlap-check, and safer to deploy. It is not a replacement for Horizon, Redis, or Laravel’s native queue primitives; use it to standardize how your team applies those primitives.
Minimal adoption path:
Install and pin the package:
composer require liberusoftware/scheduler-queues
Pin a specific tag or commit in composer.json. With zero stars/dependents, avoid floating constraints in production.
Check service-provider discovery. If the package is not auto-discovered, register its provider in bootstrap/providers.php or config/app.php.
Publish only what you need:
php artisan vendor:publish --provider="Liberu\\SchedulerQueues\\SchedulerQueuesServiceProvider"
Confirm the actual provider namespace and publish tags from the README or src/.
If the package ships migrations for locks, failures, or monitoring, run them:
php artisan migrate
Look first at:
README.md for the intended job contract/trait and config keysconfig/scheduler-queues.phpsrc/Contracts, src/Concerns, src/Middleware, src/Consoletests/ for the package’s expected usageFirst use case: pick one high-risk queued job — a webhook handler, invoice charge, export, or notification — and make it idempotent with a stable business key. Then add a unique/overlap lock and verify behavior with two workers locally. Once that works, standardize the pattern across other jobs and schedules.
Given the low adoption signals, keep a fallback path using Laravel’s native ShouldBeUnique, WithoutOverlapping, onOneServer, and middleware. The package should reduce convention drift, not become an unexamined critical dependency.
Use the package as a policy layer around jobs that must not run twice for the same logical operation.
Idempotent job policy
uniqid() or the job instance. Good keys: invoice:{id}:charge, webhook:{provider}:{event_id}, export:{tenant_id}:{report_id}:{date}.Dispatch workflow
DB::afterCommit(fn () => MyJob::dispatch($id, $idempotencyKey));
Otherwise a worker can run before the transaction is visible, causing retries or false uniqueness conflicts.uniqueFor, set it from the job’s realistic maximum lifespan.Scheduler workflow
onOneServer() where the schedule must not run on every node, and withoutOverlapping() where the task must not overlap itself.php artisan schedule:list after changes and test with schedule:run in staging.Retries and failures
$tries, $backoff, $maxExceptions, and retryUntil() where appropriate.Graceful deployment
php artisan queue:restart after deploying worker code.stopwaitsecs greater than the longest reasonable job duration.Testing
Queue::fake() to assert dispatch and uniqueness-key construction.ShouldBeUnique or WithoutOverlapping, confirm whether the package adds another lock. Two lock systems with different TTLs produce surprising skipped jobs and stuck locks.file cache break across servers and sometimes across workers. Use Redis or database-backed cache and verify the same store is used by web and queue processes.afterCommit matters. Dispatching inside a transaction can create unique-lock ghosts or jobs that retry before the data exists.withoutOverlapping() protects the schedule from overlapping runs; it does not make the underlying job idempotent.How can I help you explore Laravel packages today?