PHPackages                             innmind/ipc - 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. innmind/ipc

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

innmind/ipc
===========

Inter-process communication

5.0.0(2mo ago)02.7k4MITPHPPHP ~8.4CI passing

Since Feb 16Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Innmind/IPC)[ Packagist](https://packagist.org/packages/innmind/ipc)[ Docs](http://github.com/Innmind/IPC)[ RSS](/packages/innmind-ipc/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (5)Dependencies (15)Versions (22)Used By (4)

Inter-Process Communication (IPC)
=================================

[](#inter-process-communication-ipc)

[![CI](https://github.com/Innmind/IPC/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Innmind/IPC/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/55ac04c93c1be1898f379fd84b05e3471e5226b4a487f8754c0150381e5e2f26/68747470733a2f2f636f6465636f762e696f2f67682f496e6e6d696e642f4950432f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/Innmind/IPC)[![Type Coverage](https://camo.githubusercontent.com/bc0f533e1e395c68659374d60a9595606e287f5455f1835523b486303d1dcfd2/68747470733a2f2f73686570686572642e6465762f6769746875622f496e6e6d696e642f4950432f636f7665726167652e737667)](https://shepherd.dev/github/Innmind/IPC)

Library to abstract the communication between processes by using message passing over unix sockets.

Installation
------------

[](#installation)

```
composer require innmind/ipc
```

Usage
-----

[](#usage)

```
# Process A
use Innmind\IPC\{
    IPC,
    Process\Name,
    Continuation,
    Server,
    Message,
};
use Innmind\OperatingSystem\Factory;
use Innmind\Immutable\Monoid;

/**
 * @psalm-immutable
 * @implements Monoid
 */
final class Addition implements Monoid
{
    public function identity(): int
    {
        return 0;
    }

    public function combine(mixed $a, mixed $b): int
    {
        return $a + $b;
    }
}

$ipc = IPC::build(Factory::build());
$counter = $ipc
    ->serve(Name::of('a'))
    ->sink(new Addition)
    ->monitor(static fn(int $counter, Server\Continuation $continuation) => match ($counter) {
        42 => $continuation->finish(),
        default => $continuation,
    })
    ->with(
        static fn(Message $message, Continuation $continuation, int $counter) => $continuation
            ->respond($message)
            ->carryWith($counter + 1),
    )
    ->unwrap();
// $counter will always be 42 in this case
```

```
# Process B
use Innmind\IPC\{
    IPC,
    Process,
    Process\Name,
    Message,
};
use Innmind\OperatingSystem\Factory;
use Innmind\MediaType\{
    MediaType,
    TopLevel,
};
use Innmind\Immutable\{
    Str,
    Sequence,
};

$ipc = IPC::build(Factory::build());
$server = Name::of('a');
$response = $ipc
    ->connectTo($server)
    ->flatMap(
        static fn(Process $process) => $process
            ->send(Sequence::of(
                Message::of(
                    MediaType::from(TopLevel::text, 'plain'),
                    Str::of('hello world'),
                ),
            ))
            ->map(static fn() => $process),
    )
    ->flatMap(fn(Process $process) => $process->wait())
    ->match(
        static fn(Message $message) => 'server responded '.$message->content()->toString(),
        static fn() => 'no response from the server',
    );
print($message);
```

The above example will result in the output `server responded hello world` in the process `B`.

You can run the process `B` `42` times before the server in the process `A` stops.

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance87

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 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

Every ~143 days

Recently: every ~285 days

Total

19

Last Release

64d ago

Major Versions

1.0.0 → 2.0.02019-02-23

2.1.1 → 3.0.02020-02-08

3.1.0 → 4.0.02022-07-14

4.4.0 → 5.0.02026-03-15

PHP version history (6 changes)1.0.0PHP ~7.2

3.0.0PHP ~7.4

3.1.0PHP ~7.4|~8.0

4.0.0PHP ~8.1

4.2.0PHP ~8.2

5.0.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (276 commits)")

---

Tags

inter-process-communicationipcprocesscommunication

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/innmind-ipc/health.svg)

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

###  Alternatives

[react/child-process

Event-driven library for executing child processes with ReactPHP.

34076.1M136](/packages/react-child-process)[cocur/background-process

Start processes in the background that continue running when the PHP process exists.

2971.9M12](/packages/cocur-background-process)[phpmentors/workflower

A BPMN 2.0 workflow engine for PHP

70652.9k4](/packages/phpmentors-workflower)[duncan3dc/fork-helper

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

73548.0k4](/packages/duncan3dc-fork-helper)[arara/process

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

16861.7k2](/packages/arara-process)[cekurte/environment

A library to get the values from environment variables and process to php data types

5884.0k7](/packages/cekurte-environment)

PHPackages © 2026

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