Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sweikenb/pcntl
Simple and easy to use thread-based process manager for PHP based on default PCNTL and POSIX functions.
https://github.com/sweikenb/pcntl
pcntl php php-library php82 posix
Last synced: 3 days ago
JSON representation
Simple and easy to use thread-based process manager for PHP based on default PCNTL and POSIX functions.
- Host: GitHub
- URL: https://github.com/sweikenb/pcntl
- Owner: sweikenb
- License: mit
- Created: 2020-10-15T16:46:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-03T17:34:37.000Z (about 2 months ago)
- Last Synced: 2024-09-04T14:49:37.674Z (23 days ago)
- Topics: pcntl, php, php-library, php82, posix
- Language: PHP
- Homepage: https://sweikenb.github.io/pcntl/
- Size: 585 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# PCNTL Library
Simple and easy to use thread-based process manager for PHP based on default PCNTL and POSIX functions.
![Build status](https://github.com/sweikenb/pcntl/actions/workflows/phpunit.yml/badge.svg)
**Further information:**
- [Docs](https://sweikenb.github.io/pcntl/)
- [Changelog](CHANGELOG.md)
- [MIT License](LICENSE.txt)## Installation
```php
composer require "sweikenb/pcntl"
```## Basic Usage
```php
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()));
});
```