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

Abandoned → [innmind/mantle](/?search=innmind%2Fmantle)ArchivedLibrary

innmind/async-stream
====================

1.0.0(3y ago)0931↓100%2MITPHPPHP ~8.1

Since Feb 11Pushed 3y ago1 watchersCompare

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

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

Async Stream
============

[](#async-stream)

[![Build Status](https://github.com/innmind/async-stream/workflows/CI/badge.svg?branch=main)](https://github.com/innmind/async-stream/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/47912aae0f082875c78b6d2f01f4aea806db8813ef2383d4544631405842b47c/68747470733a2f2f636f6465636f762e696f2f67682f696e6e6d696e642f6173796e632d73747265616d2f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/innmind/async-stream)[![Type Coverage](https://camo.githubusercontent.com/661d0dc995392fd2e9881bdcb01082ecc6cef44ce6f3750970df43be4f3ca097/68747470733a2f2f73686570686572642e6465762f6769746875622f696e6e6d696e642f6173796e632d73747265616d2f636f7665726167652e737667)](https://shepherd.dev/github/innmind/async-stream)

Async implementation of [`innmind/stream`](https://packagist.org/packages/innmind/stream) to allow switching to another task when reading, writing or watching for streams.

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

[](#installation)

```
composer require innmind/async-stream
```

Usage
-----

[](#usage)

```
use Innmind\Async\Stream\Streams;
use Innmind\Stream\Streams as Synchronous;
use Innmind\TimeContinuum\Earth\Clock;
use Innmind\Url\Path;
use Innmind\Mantle\{
    Source\Predetermined,
    Suspend,
    Forerunner,
};

$clock = new Clock;
$synchronous = Synchronous::fromAmbientAuthority();
$source = Predetermined::of(
    static function(Suspend $suspend) use ($clock, $synchronous) {
        $stream = Streams::of($synchronous, $suspend, $clock)
            ->readable()
            ->open(Path::of('fixtures/first.txt'));

        while (!$stream->end()) {
            echo $stream->readLine()->match(
                static fn($line) => $line->toString(),
                static fn() => '',
            );
        }
    },
    static function(Suspend $suspend) use ($clock, $synchronous) {
        $stream = Streams::of($synchronous, $suspend, $clock)
            ->readable()
            ->open(Path::of('fixtures/second.txt'));

        while (!$stream->end()) {
            echo $stream->readLine()->match(
                static fn($line) => $line->toString(),
                static fn() => '',
            );
        }
    },
);

Forerunner::of($clock)(null, $source); // will print interlaced lines of both files
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

1182d ago

### 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 (8 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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