PHPackages                             slince/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. slince/process

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

slince/process
==============

The process wrapper and manager based on pcntl and posix.

1.0.0(9y ago)24892MITPHPPHP &gt;=5.5.9

Since Apr 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/slince/process)[ Packagist](https://packagist.org/packages/slince/process)[ RSS](/packages/slince-process/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (0)

Process Library
===============

[](#process-library)

[![Build Status](https://camo.githubusercontent.com/bedab25c398b3dbf18a066a8fa6e78f1484f8f695a428ba65e649670e4dddb2e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736c696e63652f70726f636573732f746573742e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/slince/process/actions)[![Coverage Status](https://camo.githubusercontent.com/6bbd247894ba1c1e55e96a15a7a9640925c7ad3ec285bf4d48ac2c1259348e91/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f736c696e63652f70726f636573732e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/github/slince/process)[![Total Downloads](https://camo.githubusercontent.com/e064732b5c048758e0ea0814020f3cc1b49cd8497ad44ab3d10c1563463f9f4d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736c696e63652f70726f636573732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/slince/process)[![Latest Stable Version](https://camo.githubusercontent.com/91e50441c55ca1b52c35dc911102b121466ef2724df995924abac27e5b6d43c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c696e63652f70726f636573732e7376673f7374796c653d666c61742d737175617265266c6162656c3d737461626c65)](https://packagist.org/packages/slince/process)[![Scrutinizer](https://camo.githubusercontent.com/e39247cc6a00acc7eaafeaff9664024dbec331e562e58de0e795f2fa09020166/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f736c696e63652f70726f636573732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/slince/process/?branch=master)

The library help to work with processes. It provides a more readable api and various modes for IPC via pipe(FIFO) and system v.

Installation
============

[](#installation)

Install via composer

```
composer require slince/process
```

Dependencies
============

[](#dependencies)

The library replies on the following php's extension.

- ext-pcntl. Provides control processes (MUST)
- ext-sysvshm. Porvides system v shared memory (OPTIONAL)
- ext-sysvsem. Porvides system v semaphore (OPTIONAL)
- ext-sysmsg. Porvides system v message queue (OPTIONAL)

Usage
=====

[](#usage)

Basic usage
-----------

[](#basic-usage)

```
$process = new Slince\Process\Process(function(){
    echo 'hello, my pid is ' . getmypid();
});
$process->start();

var_dump($process->isRunning()); // echo true
var_dump($process->getPid()); // will output the pid of child process
//do something other

$process->wait(); //waiting for the process to exit
```

Sends signal to the process
---------------------------

[](#sends-signal-to-the-process)

> Note: If your php version is less than 7.1, please add the statement `declare(ticks=1);` at the beginning of the file:

```
$process = new Slince\Process\Process(function(){
    Slince\Process\Process::current()->signal([SIGUSR1, SIGUSR2], function(){
        echo 'trigger signal';
    });
    echo 'hello, my pid is ' . getmypid();
});
$process->start();
$process->signal(SIGUSER1);
//do something
$process->wait();
```

Shared memory
-------------

[](#shared-memory)

```
$memory = new Slince\Process\SystemV\SharedMemory();
$memory->set('foo', 'bar');
var_dump($memory->get('foo'));
```

The default size of shared memory is the sysvshm.init\_mem in the php.ini, otherwise 10000 bytes. You can adjust this.

```
$memory = new Slince\Process\SystemV\SharedMemory(__FILE__, '5M'); //Adjusts to 5m
```

Semaphore
---------

[](#semaphore)

```
$semaphore = new Slince\Process\SystemV\Semaphore();
$semaphore->acquire(); //Acquires a lock
// do something
$semaphore->release() //Releases a lock
```

Message queue
-------------

[](#message-queue)

```
$queue  = new Slince\Process\SystemV\MessageQueue();
$queue->send('hello');
echo $queue->receive(); //Will output hello
```

Fifo
----

[](#fifo)

```
$writeFifo = new Slince\Process\Pipe\WritableFifo('/tmp/test.pipe');
$writeFifo->write('some message');
$readFifo = new Slince\Process\Pipe\ReadableFifo('/tmp/test.pipe');
echo $readFifo->read();
```

License
-------

[](#license)

The MIT license. See [MIT](https://opensource.org/licenses/MIT)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3350d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3785826?v=4)[Tao](/maintainers/slince)[@slince](https://github.com/slince)

---

Top Contributors

[![slince](https://avatars.githubusercontent.com/u/3785826?v=4)](https://github.com/slince "slince (39 commits)")

---

Tags

child-processfifoforkpcntlpipeposixprocesssemaphoreshared-memorysystem-vposixprocesssemaphorepipeforkpcntlshared memorychild-processsystem v

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/slince-process/health.svg)

```
[![Health](https://phpackages.com/badges/slince-process/health.svg)](https://phpackages.com/packages/slince-process)
```

###  Alternatives

[arara/process

Provides a better API to work with processes on Unix-like systems

16862.4k2](/packages/arara-process)[misterion/ko-process

Simple pcntl fork wrapper and process manager

177340.8k6](/packages/misterion-ko-process)[duncan3dc/fork-helper

Simple class to fork processes in PHP and allow multi-threading

73566.2k4](/packages/duncan3dc-fork-helper)[seld/signal-handler

Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development

18276.5M26](/packages/seld-signal-handler)[lifo/php-ipc

Simple PHP Inter Process Communication (IPC) library

285.6k](/packages/lifo-php-ipc)[php-lrpm/php-lrpm

PHP Long Running Process Manager

188.7k1](/packages/php-lrpm-php-lrpm)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
