PHPackages                             mkolecki/sub-process - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mkolecki/sub-process

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mkolecki/sub-process
====================

Library for creating new processes for PHP

25PHPCI failing

Since Sep 20Pushed 6y ago2 watchersCompare

[ Source](https://github.com/mateusz-kolecki/sub-process)[ Packagist](https://packagist.org/packages/mkolecki/sub-process)[ RSS](/packages/mkolecki-sub-process/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/d11a9fa6911fd41328846f7b14d3116386498f51adc49588f3b777e85cf51aa1/68747470733a2f2f7472617669732d63692e6f72672f6d61746575737a2d6b6f6c65636b692f7375622d70726f636573732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mateusz-kolecki/sub-process)

sub-process
===========

[](#sub-process)

PHP process forking made easy.

This library will help you to fork process and manage it state.

Install
-------

[](#install)

```
composer require mkolecki/sub-process
```

Usage
-----

[](#usage)

RealPcntl fork and communication
--------------------------------

[](#realpcntl-fork-and-communication)

To fork to sub-process first create `SubProcess\Process` instance and then call `start()` method.

To controll what new `Process` will do, you have to pass `callable`. That `callable` will receive `Process` instance which has `Channel` to `send()` and `read()` messages between parrent and child process.

Example `examples/02-channel-communication.php`:

```
