PHPackages                             krinfreschi/async-streams - 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. krinfreschi/async-streams

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

krinfreschi/async-streams
=========================

v0.0.3(11y ago)128[1 issues](https://github.com/krinfreschi/async-streams/issues)MITPHP

Since Jul 26Pushed 11y ago3 watchersCompare

[ Source](https://github.com/krinfreschi/async-streams)[ Packagist](https://packagist.org/packages/krinfreschi/async-streams)[ RSS](/packages/krinfreschi-async-streams/feed)WikiDiscussions master Synced today

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

\##AsyncStreams
===============

[](#asyncstreams)

A stream wrapper around [reactphp](https://github.com/reactphp/event-loop) for async streams

With inspiration from [guzzle/streams](https://github.com/guzzle/streams)

\##Installation

This package can be installed easily using Composer. Simply add the following to the composer.json file at the root of your project:

```
{
  "require": {
    "krinfreschi/async-streams": "0.0.*"
  }
}
```

Then install your dependencies using composer.phar install.

\##Global Functions:

```
async_stream_register_read(resource $handle, callable $callable) //$callable will receive args: $handle
async_stream_remove_read(resource $handle)
async_stream_register_write(resource $handle, callable $callable) //$callable will receive args: $handle, $written, $unwritten
async_stream_remove_write(resource $handle)
```

\##Example:

```
use krinfreschi\AsyncStreams\AsyncStreamWrapper;

require_once "vendor/autoload.php";

$resource = fopen('php://temp', 'r+');
$handle = AsyncStreamWrapper::make($resource);
fwrite($handle, 'data');

async_stream_register_write($handle, function($handle, $written, $unwritten) {
    fseek($handle, 0);
    var_dump(stream_get_contents($handle));
    fclose($handle);
});

AsyncStreamWrapper::run();
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

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 ~0 days

Total

3

Last Release

4305d ago

### Community

Maintainers

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

---

Top Contributors

[![krinfreschi](https://avatars.githubusercontent.com/u/7346075?v=4)](https://github.com/krinfreschi "krinfreschi (20 commits)")

### Embed Badge

![Health badge](/badges/krinfreschi-async-streams/health.svg)

```
[![Health](https://phpackages.com/badges/krinfreschi-async-streams/health.svg)](https://phpackages.com/packages/krinfreschi-async-streams)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k234.7M20.6k](/packages/friendsofphp-php-cs-fixer)[react/react

ReactPHP: Event-driven, non-blocking I/O with PHP.

9.1k3.6M63](/packages/react-react)[react/stream

Event-driven readable and writable streams for non-blocking I/O in ReactPHP

688126.8M194](/packages/react-stream)[react/child-process

Event-driven library for executing child processes with ReactPHP.

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

ZeroMQ bindings for React.

2471.7M31](/packages/react-zmq)[carlosbuenosvinos/ddd

Domain-Driven Design PHP helper classes (Application Services, Transactions, Domain Events, etc.

665193.1k4](/packages/carlosbuenosvinos-ddd)

PHPackages © 2026

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