PHPackages                             rx/stream - 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. rx/stream

ActiveLibrary

rx/stream
=========

Async Stream for RxPHP

3.0.2(6y ago)32.3k21MITPHPPHP ^7.0CI failing

Since Jan 23Pushed 6y ago2 watchersCompare

[ Source](https://github.com/RxPHP/RxStream)[ Packagist](https://packagist.org/packages/rx/stream)[ RSS](/packages/rx-stream/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (5)Versions (12)Used By (1)

Stream Component
================

[](#stream-component)

Provides RxPHP Observables for PHP streams

This library is a wrapper around the [ReactPHP](https://github.com/reactphp/stream) stream library. It uses the [Voryx event-loop](https://github.com/voryx/event-loop) which behaves like the Javascript event-loop. ie. You don't need to start it.

Usage
-----

[](#usage)

### From File

[](#from-file)

```

    $source = new \Rx\React\FromFileObservable("example.csv");

    $source
        ->cut() //Cut the stream by PHP_EOL
        ->map('str_getcsv') //Convert csv row to an array
        ->map(function (array $row) {
            //Strip numbers from the first field
            $row[0] = preg_replace('/\d+/u', '', $row[0]);
            return $row;
        })
        ->subscribe(
            function ($data) {
                echo $data[0] . "\n";
            },
            function ($e) {
                echo "error\n";
            },
            function () {
                echo "done\n";
            }
        );

```

### Read and Write to File

[](#read-and-write-to-file)

```
$source = new \Rx\React\FromFileObservable("source.txt");
$dest   = new \Rx\React\ToFileObserver("dest.txt");

$source
    ->cut()
    ->filter(function ($row) {
        return strpos($row, 'foo');
    })
    ->map(function ($row) {
        return $row . 'bar';
    })
    ->subscribe($dest);
```

### Stream - echo example

[](#stream---echo-example)

```
$read  = new \Rx\React\StreamSubject(STDIN);

$read
    ->takeWhile(function ($x) {
        return trim($x) != 15;
    })
    ->subscribe(new \Rx\React\StreamSubject(STDOUT));

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 95% 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 ~156 days

Recently: every ~285 days

Total

11

Last Release

2201d ago

Major Versions

0.2.1 → 2.0.02017-01-05

2.0.3 → 3.0.02017-12-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d3dd76986135ec7771465f6e0e187478b3d4b50ed4bde14da7e27db84c35f14?d=identicon)[mbonneau](/maintainers/mbonneau)

![](https://www.gravatar.com/avatar/97c5ea11cb85867441e824660b316d8c4c081400e21781c56bb561f1f5b0bb87?d=identicon)[davidwdan](/maintainers/davidwdan)

---

Top Contributors

[![davidwdan](https://avatars.githubusercontent.com/u/4969183?v=4)](https://github.com/davidwdan "davidwdan (19 commits)")[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (1 commits)")

---

Tags

streamreactphpreactrx.phpreactivex

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rx-stream/health.svg)

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

###  Alternatives

[react/socket

Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP

1.3k116.9M402](/packages/react-socket)[react/promise-stream

The missing link between Promise-land and Stream-land for ReactPHP

11512.9M45](/packages/react-promise-stream)[rx/http

Http Client for RxPHP

221.5k2](/packages/rx-http)[voryx/pgasync

Async Reactive Postgres Driver for PHP (Non-blocking)

11294.0k4](/packages/voryx-pgasync)[domraider/rxnet

Rx connector for PHP

1308.6k1](/packages/domraider-rxnet)[rxnet/eventstore-client

EventStore asynchronous PHP client with reactiveX flavours

2642.9k2](/packages/rxnet-eventstore-client)

PHPackages © 2026

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