aboutcoders/process-control-bundle
Symfony bundle providing process control via a container service (abc.process_control.controller). Default PCNTL implementation listens for SIGTERM so long-running jobs can detect when to exit. Service registration can be disabled via configuration.
SIGTERM signals), which aligns with use cases requiring graceful shutdowns, long-running processes, or worker management in Symfony/Laravel applications.symfony/service-container). This introduces abstraction overhead but remains feasible.SIGTERM), lacking broader process orchestration (e.g., job queues, distributed workers). May require complementary tools (e.g., Laravel Queues, Supervisor) for production-grade workflows.abc.process_control.controller) can be manually instantiated or bound.pcntl extension (Linux/macOS only). Windows support is non-existent, requiring Docker/VMs or alternative signal handling (e.g., HTTP callbacks).config/abc_process_control.php.pcntl is not enabled by default in many PHP environments (e.g., shared hosting). Risk of runtime failures if unchecked.SIGTERM is not universally supported (e.g., PHP-FPM may ignore it).~1.0 suggests early-stage stability; potential for breaking changes.SIGTERM handling the primary requirement, or are broader process management features (e.g., job retries, scaling) needed?SIGTERM hooks) or Supervisor replace this bundle?pcntl is disabled? Is a fallback mechanism (e.g., HTTP health checks) needed?SIGTERM) be handled?symfony/service-container and symfony/dependency-injection to replicate Symfony’s DI system.AppServiceProvider:
$this->app->singleton('abc.process_control.controller', function ($app) {
return new \Abc\Bundle\ProcessControlBundle\Service\Controller();
});
pcntl with a custom signal handler (e.g., polling a shutdown flag via HTTP).registerShutdownFunction as a secondary layer.laravel/symfony-bridge).SIGTERM handling in a local Docker container (Linux).config/abc_process_control.php.facade(ProcessControl::class, \Abc\Bundle\ProcessControlBundle\Facade::class);
pcntl (Linux/macOS) or a custom replacement (Windows).symfony/dependency-injection may introduce bloat if unused elsewhere.SIGTERM handling is critical or optional.SIGTERM events (e.g., Laravel’s Log::info).pcntl issues are hard to reproduce in CI (Windows agents may fail silently).SIGTERM handling is per-process; useful for single-instance or worker-based setups (e.g., Laravel Queues).| Failure Scenario | Impact | Mitigation |
|---|---|---|
pcntl extension missing |
Bundle fails to load | Fallback to HTTP-based shutdown hooks |
SIGTERM ignored by PHP-FPM |
Process hangs on shutdown | Use fastcgi_finish_request() + custom handler |
| Bundle not updated | Security/feature regressions | Fork and maintain privately |
| Laravel/PCNTL compatibility issues | Undefined behavior | Test in staging with Docker (Linux) |
| Windows deployment | Signal handling fails | Replace with cron/Supervisor checks |
pcntl or DI.terminate() method.pcntl availability.How can I help you explore Laravel packages today?