yuna / supervisor
1.2.5
2025-10-23 17:10 UTC
Requires
- php: >=8.2
- ext-pcntl: *
- ext-posix: *
- amphp/amp: ^3.1
- amphp/http-client: ^5.3
- amphp/process: ^2.0
- psr/log: ^3.0
- symfony/event-dispatcher: ^6.4
- symfony/http-client: ^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 - possible thanks to amphp.
Requirements:
- PCNTL
- PHP 8.2
Features:
- health checks
- dependencies
- retries
Installation
composer require yuna/supervisor:^1
Example
$supervisor = new Yuna\Supervisor\Supervisor(
services: [
ServiceBuilder::create()
->name('nginx')
->command("nginx -g 'daemon off;'")
->dependencies([
'php-fpm' => ServiceState::Healthy
])
->build(),
ServiceBuilder::create()
->name('php-fpm')
->command("php-fpm")
->healthcheck(fn() => HealthChecker::socket('localhost', 9000))
->build()
],
logger: new Logger(debug: false) // optional - must implement Psr\Log\LoggerInterface
);
exit($supervisor->run());