Skip to content

aboutcoders/process-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Process Control

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages