sweikenb / pcntl
PCNTL process control library
Installs: 7 323
Dependents: 0
Suggesters: 2
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^8.2
- ext-pcntl: *
- ext-posix: *
- ext-sockets: *
Requires (Dev)
- phpunit/phpunit: ^10.3
Conflicts
- ext-grpc: *
README
Simple and easy to use thread-based process manager for PHP based on default PCNTL and POSIX functions.
Further information:
Installation
composer require "sweikenb/pcntl"
Basic Usage
use Sweikenb\Library\Pcntl\ProcessManager; use Sweikenb\Library\Pcntl\Api\ChildProcessInterface; use Sweikenb\Library\Pcntl\Api\ParentProcessInterface; use Sweikenb\Library\Pcntl\Api\ProcessOutputInterface; $pm = new ProcessManager(); $pm->runProcess(function(ChildProcessInterface $child, ParentProcessInterface $parent, ProcessOutputInterface $output) { $output->stdout(sprintf('Hello World from PID: %d', $child->getId())); });