sweikenb / pcntl

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

Home Page:https://sweikenb.github.io/pcntl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PCNTL Library

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

About

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

https://sweikenb.github.io/pcntl/

License:MIT License


Languages

Language:PHP 100.0%