PHPackages                             riki137/stream-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. [Queues &amp; Workers](/categories/queues)
4. /
5. riki137/stream-ipc

ActiveLibrary[Queues &amp; Workers](/categories/queues)

riki137/stream-ipc
==================

Inter-Process Communication (IPC) over streams, pipes, and stdio with built-in request-response correlation, message framing, and serialization.

1.0.0(9mo ago)14.6k↓23.7%1MITPHPPHP ^8.2CI passing

Since Jun 18Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/riki137/php-stream-ipc)[ Packagist](https://packagist.org/packages/riki137/stream-ipc)[ RSS](/packages/riki137-stream-ipc/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (8)Used By (1)

🚀 **PHP Stream IPC**: Simple, Reliable Inter-Process Communication in Pure PHP
==============================================================================

[](#-php-stream-ipc-simple-reliable-inter-process-communication-in-pure-php)

[![Packagist Version](https://camo.githubusercontent.com/598572387a89128bc0bf121a24550dc6d721413099492cbdb65c0877eb37e2f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72696b693133372f73747265616d2d6970632e737667)](https://packagist.org/packages/riki137/stream-ipc)[![Code Coverage](https://camo.githubusercontent.com/c09bb5067da2e8802f9ab3cb7ac647c10c91ef95f2a5261110586bd13bd38035/68747470733a2f2f636f6465636f762e696f2f67682f72696b693133372f7068702d73747265616d2d6970632f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/riki137/php-stream-ipc)[![GitHub Tests](https://github.com/riki137/php-stream-ipc/actions/workflows/tests.yml/badge.svg)](https://github.com/riki137/php-stream-ipc/actions/workflows/tests.yml)[![PHPStan Level 8](https://camo.githubusercontent.com/c51bda247654363d3e30bc352674dd761a9557803a14af0226eb411d6dc0006b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c253230382d627269676874677265656e2e737667)](https://github.com/phpstan/phpstan)[![PHP Version](https://camo.githubusercontent.com/c4cb15211c4877edfadd698af9c744a788506d1bbd430a344333c3b14c5d943e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d3838393242462e737667)](https://www.php.net/)[![License](https://camo.githubusercontent.com/07a7d0169027aac6d7a0bfa8964dfef5fbc40d5a2075cabb3d8bc67e17be3451/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)

PHP Stream IPC is a **lightweight, zero-dependency** PHP library designed for robust **IPC** (inter-process communication) **through streams, pipes, sockets, and standard I/O**. Whether you're managing background jobs, orchestrating parallel tasks, or simply need efficient communication between PHP processes, PHP Stream IPC makes it straightforward, reliable, and fast.

Forget complicated setups or bloated frameworks—this library is pure PHP, requiring **no external dependencies**, and seamlessly integrates with native PHP streams, Symfony's popular `Process` component or AMPHP's ByteStream component (or your own adapter). It handles everything from framing messages to correlating requests and responses, enabling your applications to effortlessly communicate in real time.

### 🔥 **Why choose PHP Stream IPC?**

[](#-why-choose-php-stream-ipc)

- **Zero Dependencies**: Lightweight, pure PHP—installs fast and clean.
- **Reliable Messaging**: Automatic message framing ensures data integrity.
- **Performance-Focused**: Built for speed and efficiency. You can send hundreds of messages per second.
- **Built-in Request-Response Handling**: Easily correlate requests with their responses, simplifying async communication.
- **Flexible Serialization**: Fast Native PHP serialization by default, with JSON support ready out of the box.
- **Easy Integration with Symfony/AMPHP**: Fits perfectly into your existing workflow.
- **Real-time Notifications and Updates**: Effortlessly handle real-time progress updates and event-driven messaging.
- **Error and Timeout Management**: Robust exception handling, graceful stream closure management, and built-in timeout control keep your processes resilient.
- **Extendable by Design**: Simple interfaces and clearly defined contracts mean you can easily adapt or extend functionality for your specific needs.

Whether you're building scalable PHP services, handling parallel background processing, or connecting multiple PHP scripts reliably, PHP Stream IPC gives you the control and simplicity you've been looking for.

---

📦 Quick Installation
--------------------

[](#-quick-installation)

Install with Composer in seconds:

```
composer require riki137/stream-ipc
```

---

⚡ 30-Second Tour
----------------

[](#-30-second-tour)

The fastest way to grok the API is to copy-paste the two files below, run `php parent.php`, and watch “Pong!” come back from a child process.

**parent.php – ask, await, done**```
