PHPackages                             phasty/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phasty/stream

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

phasty/stream
=============

PHP stream library

0.2.2(10y ago)013.8k2[2 PRs](https://github.com/phasty/Stream/pulls)3PHP

Since Jul 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/phasty/Stream)[ Packagist](https://packagist.org/packages/phasty/stream)[ RSS](/packages/phasty-stream/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (7)Used By (3)

Stream
======

[](#stream)

This component is wrapper for different kind of php streams

Usage
-----

[](#usage)

Classes of this package allow you to deal with such streams as files, sockets, pipes, i/o-streams and so on with ability to use them in non-blocking manner:

```
use Phasty\Stream\Stream;
use Phasty\Stream\StreamSet;
use Phasty\Stream\Timer;

// use wrapper for STDIN
$readStream = new Stream(STDIN);
// streamset allows you work with different streams at sames time tih interraptions for timers
$streamSet = StreamSet::instance();
$streamSet->addReadStream($readStream);
$readStream->on("data", function($event) use ($streamSet) {
    $data = $event->getData();
    if (trim($data) === "q") {
        $streamSet->stop();
        return;
    }
    echo "you wrote: " . $event->getData();
});
$timer = new Timer(2, 0, function() {
    echo "Now: " . date("H:i:s"), "\n";
});
$streamSet->addTimer($timer);
$streamSet->listen();
echo "exiting\n";

```

You will get something like this:

```
Now: 20:52:11
dawd
you wrote: dawd
Now: 20:52:13
q
exiting

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

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

Every ~112 days

Recently: every ~141 days

Total

6

Last Release

3785d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b559c62236aec6a4e7bbae280dbd80d31542a5b26ec7cc86ce29bd098cb97b30?d=identicon)[dedestr](/maintainers/dedestr)

---

Top Contributors

[![dedestrt](https://avatars.githubusercontent.com/u/2020598?v=4)](https://github.com/dedestrt "dedestrt (8 commits)")

---

Tags

streamphp

### Embed Badge

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

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

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21422.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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