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

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

rx/await
========

Provides await functionality for RxPHP

2.1.0(8y ago)52.1k2MITPHP

Since Feb 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/RxPHP/RxAwait)[ Packagist](https://packagist.org/packages/rx/await)[ RSS](/packages/rx-await/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Await for RxPHP
===============

[](#await-for-rxphp)

This library will allow observables to block until complete. For use when combining observables with imperative code.

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.

### Basic Example

[](#basic-example)

```
require __DIR__ . '/../vendor/autoload.php';

//Do some aysnc craziness with observables
$observable = \Rx\Observable::interval(1000);

//Returns a `Generator` with the results of the observable
$generator = \Rx\await($observable);

//You can now use the results like a regular `Iterator`
foreach ($generator as $item) {

    //Will block here until the observable completes
    echo $item, PHP_EOL;
}
```

### Timeout Example

[](#timeout-example)

Since observables can return 1 to an infinite number of results, you'll need to make sure that you either limit the number of items you take or use a timeout or it could block forever.

```
require __DIR__ . '/../vendor/autoload.php';

$source = \Rx\Observable::interval(1000)
    ->takeUntil(\Rx\Observable::timer(10000)); //timeout after 10 seconds

$generator = \Rx\await($source);

foreach ($generator as $item) {
    echo $item, PHP_EOL;
}

echo "DONE";
```

```
$source = \Rx\Observable::interval(1000)
    ->take(5); //Limit items to 5

$generator = \Rx\await($source);

foreach ($generator as $item) {
    echo $item, PHP_EOL;
}

echo "DONE";
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~401 days

Total

3

Last Release

2996d ago

Major Versions

0.1.0 → 2.0.02018-04-18

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4969183?v=4)[David Dan](/maintainers/davidwdan)[@davidwdan](https://github.com/davidwdan)

---

Top Contributors

[![davidwdan](https://avatars.githubusercontent.com/u/4969183?v=4)](https://github.com/davidwdan "davidwdan (8 commits)")[![Vinceveve](https://avatars.githubusercontent.com/u/912570?v=4)](https://github.com/Vinceveve "Vinceveve (2 commits)")

---

Tags

reactphpawaitrx.phpreactivex

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[react/react

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

9.1k3.7M65](/packages/react-react)[react/stream

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

691139.1M207](/packages/react-stream)[react/child-process

Event-driven library for executing child processes with ReactPHP.

34691.0M152](/packages/react-child-process)[clue/utf8-react

Streaming UTF-8 parser, built on top of ReactPHP.

6611.0M3](/packages/clue-utf8-react)[voryx/pgasync

Async Reactive Postgres Driver for PHP (Non-blocking)

11295.9k4](/packages/voryx-pgasync)[rx/http

Http Client for RxPHP

231.5k2](/packages/rx-http)

PHPackages © 2026

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