Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Worker Laravel Package

patchlevel/worker

A lightweight worker abstraction for Laravel/PHP apps, providing long-running background process loops with graceful shutdown, signal handling, and support for event-driven or subscription-based workloads.

Deep Wiki
Context7

patchlevel/worker is a lightweight package for building long-lived background workers in Laravel applications. It gives you a small, framework-native foundation for running custom worker loops alongside your existing queue and job infrastructure.

Workers are resolved through Laravel's service container, so dependencies, configuration, and testing stay familiar. The package focuses on clean lifecycle handling rather than replacing Laravel's queue system.

  • Graceful shutdown on termination signals
  • Container-aware worker resolution
  • Configurable loops and intervals
  • Simple, testable worker classes
  • Minimal footprint with no extra services
Frequently asked questions about Worker
What is patchlevel/worker used for?
patchlevel/worker is a lightweight worker abstraction for Laravel and PHP applications that need long-lived background processes. It helps with clean startup, signal handling, execution limits, and graceful shutdown. Typical uses include custom daemons, queue-like processors, and background tasks that must terminate properly when limits are exceeded.
How do I install patchlevel/worker in a Laravel app?
Install the package with Composer using composer require patchlevel/worker. Then integrate its worker abstraction into your long-running command or daemon and configure limits and shutdown behavior for your use case. Check the package README for any service provider, configuration, or publishing steps specific to your version.
Does patchlevel/worker handle signals and graceful shutdown?
Yes, the package is designed around clean startup, signal handling, and graceful shutdown for long-running PHP processes. This helps workers respond properly to termination requests instead of being killed abruptly. You should still test shutdown behavior under your process manager and deployment setup.
Can I use patchlevel/worker for custom daemons and queue-like tasks?
Yes, it is intended for background processes such as custom daemons and queue-like workers. It provides a lightweight abstraction rather than tying you to Laravel's standard queue workflow. That makes it useful when you need control over startup, limits, signals, and shutdown.
How do I configure a worker to terminate when limits are exceeded?
The package is built to help a worker terminate properly when configured limits are exceeded. You define the relevant limits in your worker implementation or configuration and rely on the package's shutdown handling to exit cleanly. Review the README for the exact limit options and expected termination behavior in your version.
Which Laravel and PHP versions does patchlevel/worker support?
The provided context does not list specific Laravel or PHP version constraints. Check the package composer.json and README for the supported version matrix before installing. Confirm compatibility with your application's PHP runtime and Laravel release, especially before upgrading either one.
How should I test workers built with patchlevel/worker?
Extract your task-handling logic from the worker loop so it can be invoked directly in unit tests. For signal handling, limits, and shutdown, use process-level or integration tests that start and terminate the worker. Keep test limits short so termination paths run quickly and reliably.
Is patchlevel/worker safe for production long-running processes?
It is intended for long-lived background processes, but production safety depends on your supervision, logging, and deployment practices. Run workers under a process manager such as Supervisor or systemd and verify graceful shutdown during deploys. Monitor memory usage and restart behavior for your specific workload.
How does patchlevel/worker compare with Laravel's built-in queue worker?
Laravel's queue:work command is specialized for processing queue jobs and includes its own lifecycle management. patchlevel/worker is a more general worker abstraction for custom daemons and background loops. Use it when you need explicit control over startup, signals, limits, and shutdown outside the standard queue workflow.
How do I handle deployments and worker restarts with patchlevel/worker?
Design workers to exit cleanly when they receive a termination signal so your process manager can restart them during deployments. Make tasks idempotent or checkpoint in-progress work where needed. The package's graceful shutdown support helps reduce abrupt terminations, but your deployment tooling should still allow enough time for workers to finish safely.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels