aboutcoders/process-control

A PHP process control library

Maintainers

👁 aboutcoders

Package info

github.com/aboutcoders/process-control

Homepage

pkg:composer/aboutcoders/process-control

Statistics

Installs: 26 117

Dependents: 3

Suggesters: 0

Stars: 4

Open Issues: 1

1.3.2 2016-12-30 15:26 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 06127a379cf4df56fd7b956341bb5c41f2f04672

  • Hannes Schulz <hannes.schulz.woop@aboutcoders.com>

processsignalcontrollercontrolpcntliteration

This package is not auto-updated.

Last update: 2026-06-18 08:48:05 UTC


README

A PHP process control library.

Build Status: 👁 Build Status

The interface

The ControllerInterface defines the method doExit() that indicates whether to exist a process.

interface ControllerInterface
{
 /**
 * Indicates whether to exit a process
 *
 * @return boolean
 */
 public function doExit();
}

The PcntlController

The PcntlController listens to PCNTL events to determine whether to exit a process.

 $stopsignals = array(SIGTERM);
 $logger = new Psr\Log\NullLogger();
 
 $controller = new PcntlController($stopsignals, $logger);
 
 while(!$controller->doExit())
 {
 // do something
 }

The ChainController

The ChainController executes multiple controllers in a chain to determine whether to exit a process.

The NullController

The NullController never indicates to exit a process.

Note: This controller can be used as fallback controller for the PcntlController in runtime environments where PCNTL functions to not exist.