sweikenb/pcntl

PCNTL process control library

Maintainers

Package info

github.com/sweikenb/pcntl

pkg:composer/sweikenb/pcntl

Statistics

Installs: 13 399

Dependents: 0

Suggesters: 2

Stars: 3

Open Issues: 0

v7.1.1 2025-04-04 10:33 UTC

This package is auto-updated.

Last update: 2026-03-04 20:54:43 UTC


README

Simple and easy to use thread-based process manager for PHP based on default PCNTL and POSIX functions.

Build status

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()));
});