yuna / supervisor
2.1.0
2025-11-19 20:37 UTC
Requires
- php: >=8.2
- ext-pcntl: *
- ext-uv: *
- amphp/log: ^2.0
- psr/log: ^3.0
- react/async: ^4.3.0
- react/child-process: ^0.6.6
- react/event-loop: ^1.5
- reactivex/rxphp: ^2.0
- symfony/http-client: ^6.4
- symfony/process: ^6.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.89
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.4
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());