yuna/supervisor

Maintainers

Details

codeberg.org/yuna/supervisor

Installs: 37

Dependents: 1

Suggesters: 0

Security: 0

pkg:composer/yuna/supervisor

2.1.0 2025-11-19 20:37 UTC

This package is not auto-updated.

Last update: 2025-12-03 20:53:05 UTC


README

Semi-simple process supervisor written in PHP.

Requirements:

  • PCNTL
    • required for proper signal handling
  • PHP 8.2
  • UV
    • just for behavior to be consistent across all PHPs

Features:

  • health checks
  • dependencies
  • retries

Installation

composer require yuna/supervisor:^2

Example

$supervisor = (new SupervisorBuilder())
    ->setLoggerFactory(new AmphpLoggerFactory())
    ->add(
        ServiceBuilder::create()
            ->name('nginx')
            ->command("nginx -g 'daemon off;'")
            ->dependencies(['php-fpm'])
            ->build()
    )
    ->add(
        ServiceBuilder::create()
            ->name('php-fpm')
            ->command("php-fpm")
            ->healthcheck(fn() => HealthChecker::socket('localhost', 9000))
            ->build()
    )
    ->create();

exit($supervisor->run());