PHPackages                             moonspot/supervisor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. moonspot/supervisor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

moonspot/supervisor
===================

Supervises forked processes

671PHP

Since Feb 22Pushed 8y ago2 watchersCompare

[ Source](https://github.com/brianlmoon/Supervisor)[ Packagist](https://packagist.org/packages/moonspot/supervisor)[ RSS](/packages/moonspot-supervisor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Supervisor - Manage a pool of PHP process
=========================================

[](#supervisor---manage-a-pool-of-php-process)

The Supervisor class will manage child process by taking a callback to be called after the child is forked. It will restart new children to replace ones that exit.

Why?
----

[](#why)

Supervisor is useful for any application that needs to have long running PHP processes.

Modern application development sometimes requires running long running PHP processes. Because Supervisor is PHP, it allows you to fork and manage processes that run existing PHP code without any modification.

One such case is managing Gearman workers. In fact, this project was inspired by how [GearmanManager](https://github.com/brianlmoon/GearmanManager/) manages workers. The plan is to make it the code that handles the process management in future versions of GearmanManager.

Example
-------

[](#example)

```
