wrep/daemonizable-command
Laravel package for turning Artisan commands into long-running daemons. It provides a base command with loop control, graceful shutdown, signal handling, and start/stop/restart support, making it easier to build reliable background workers and scheduled tasks.
execute() method into a managed loop with signal handling and a configurable shutdown grace period — roughly a few days of engineering you'd otherwise write and re-debug.--max-time — more important, not less. Treat these as a paired decision.DaemonizableCommand instead of Illuminate\Console\Command, forfeiting container-injected handle(), signature parsing ergonomics, output helpers, and framework lifecycle hooks. That trade is usually negative, so the decision this most often supports is "no" — which is still a decision worth documenting.Consider it when:
pcntl_signal / pcntl_async_signals handling.Look elsewhere when:
queue:work with --max-time, --max-jobs, --memory, --tries, --backoff; Horizon if you're on Redis; schedule:run with withoutOverlapping() and onOneServer() for cron-shaped work.messenger:consume with --time-limit and --memory-limit gives you transports, retries, and failure handling this package intentionally does not.To executives: This is a small, mature utility that saves a few days of engineering on a narrow problem — running a background process cleanly and shutting it down without losing work. It is a tactical dependency, not a platform bet. Low stars and a single-maintainer profile mean we should not build a roadmap pillar on it. Recommendation: adopt only if a specific Symfony poller needs it; otherwise default to framework-native workers, which are better supported and already covered by our operational tooling.
To engineering: It's a Symfony Console base class that converts execute() into a managed loop with SIGTERM/SIGINT handling and a shutdown grace period. In a Laravel codebase the integration cost is real — you give up Illuminate\Console\Command — so the net win is usually negative unless framework-agnosticism is the explicit goal. Where we do adopt it, pair it with an explicit recycling policy (--max-time or a max-iterations counter), structured logging on loop start/stop, and a heartbeat metric, because an endless loop with no exit observability is an outage waiting to happen. Budget a plan B: pin the version and be prepared to vendor the ~few hundred lines if maintenance lapses.
How can I help you explore Laravel packages today?