PHPackages                             react-parallel/event-loop - 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. react-parallel/event-loop

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

react-parallel/event-loop
=========================

🌀🌉🌀 Event Loop bridge to ext-parallel Events

2.1.0(1y ago)472.7k↑283.8%[1 issues](https://github.com/reactphp-parallel/event-loop/issues)[2 PRs](https://github.com/reactphp-parallel/event-loop/pulls)7MITMakefilePHP ^8.3CI passing

Since Jul 6Pushed 2w ago1 watchersCompare

[ Source](https://github.com/reactphp-parallel/event-loop)[ Packagist](https://packagist.org/packages/react-parallel/event-loop)[ GitHub Sponsors](https://github.com/WyriHaximus)[ RSS](/packages/react-parallel-event-loop/feed)WikiDiscussions 2.x Synced today

READMEChangelog (6)Dependencies (8)Versions (13)Used By (7)

Event Loop bridge to ext-parallel Events
========================================

[](#event-loop-bridge-to-ext-parallel-events)

[![Continuous Integration](https://github.com/Reactphp-parallel/event-loop/workflows/Continuous%20Integration/badge.svg)](https://github.com/Reactphp-parallel/event-loop/workflows/Continuous%20Integration/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/e63f0e79689c4b4a3e45410ec521b179af595777d7cb6563f6d164d32ff49afa/68747470733a2f2f706f7365722e707567782e6f72672f52656163742d706172616c6c656c2f6576656e742d6c6f6f702f762f737461626c652e706e67)](https://packagist.org/packages/React-parallel/event-loop)[![Total Downloads](https://camo.githubusercontent.com/889c82f1a7ada2cc5e5a1bca3100fcbdc16cc97fb0dfec01dc8974102a56f5d2/68747470733a2f2f706f7365722e707567782e6f72672f52656163742d706172616c6c656c2f6576656e742d6c6f6f702f646f776e6c6f6164732e706e67)](https://packagist.org/packages/React-parallel/event-loop)[![Type Coverage](https://camo.githubusercontent.com/7c1689b0fd124b5b06653d583de14fdf7290bf045ea4ebd1845555e06eb7ba92/68747470733a2f2f73686570686572642e6465762f6769746875622f52656163747068702d706172616c6c656c2f6576656e742d6c6f6f702f636f7665726167652e737667)](https://shepherd.dev/github/Reactphp-parallel/event-loop)[![License](https://camo.githubusercontent.com/6f45aa0ea68ec5a9cf9e5d6a70a0d7df769012f133429f34dbdf2684ee860096/68747470733a2f2f706f7365722e707567782e6f72672f52656163742d706172616c6c656c2f6576656e742d6c6f6f702f6c6963656e73652e706e67)](https://packagist.org/packages/React-parallel/event-loop)

### Installation

[](#installation)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `~`.

```
composer require react-parallel/event-loop

```

Usage
=====

[](#usage)

Set up
------

[](#set-up)

Just like the ReactPHP event loop, you should only have one bridge. You can have multiple, and unlike the ReactPHP event loop, that will work, but it adds additional overhead when you have more than a few. Having a hand full for different major contexts. Share this bridge around so that other packages can use them, and only have one instance checking for events.

Channels
--------

[](#channels)

Channels often have a stream of messages going over them, as such the bridge will convert them into an observable.

```
use parallel\Channel;
use React\EventLoop\Loop;
use ReactParallel\EventLoop\EventLoopBridge;
use function React\Async\async;
use function React\Async\await;
use function React\Promise\Timer\sleep;

$eventLoopBridge = new EventLoopBridge();

Loop::futureTick(async(static function () use ($eventLoopBridge) {
    /** @var Channel */
    $channel = new Channel(Channel::Infinite);

    Loop::futureTick(async(function () use ($channel): void {
        $channel->send('Hello World!');
        // Don't close the channel right after writing to it,
        // as it will be closed on both ends and the other
        // thread won't receive your message
        await(sleep(1));
        $channel->close();
    }));

    foreach ($eventLoopBridge->observe($channel) as $message) {
        echo $message, PHP_EOL;
    }
}));
```

Futures
-------

[](#futures)

Where promises are push, futures are pull, as such the event loop will poll and resolve the promise once a result is available.

```
use React\EventLoop\Loop;
use ReactParallel\EventLoop\EventLoopBridge;
use function parallel\run;
use function React\Async\async;

$eventLoopBridge = new EventLoopBridge();

Loop::futureTick(async(static function () use ($eventLoopBridge) {
    $future = run(function (): string {
        return 'Hello World!';
    });

    echo $eventLoopBridge->await($future), PHP_EOL;
}));
```

Metrics
-------

[](#metrics)

This package supports metrics through [`wyrihaximus/metrics`](https://github.com/wyrihaximus/php-metrics):

```
use React\EventLoop\Factory;
use ReactParallel\EventLoop\EventLoopBridge;
use ReactParallel\EventLoop\Metrics;
use WyriHaximus\Metrics\Configuration;
use WyriHaximus\Metrics\InMemory\Registry;

$loop = Factory::create();
$eventLoopBridge = (new EventLoopBridge($loop))->withMetrics(Metrics::create(new Registry(Configuration::create())));
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

Copyright 2025 [Cees-Jan Kiewiet](http://wyrihaximus.net/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance70

Regular maintenance activity

Popularity34

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 64.4% 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 ~357 days

Recently: every ~502 days

Total

7

Last Release

42d ago

Major Versions

1.2.0 → 2.0.02025-02-09

PHP version history (4 changes)1.0.0PHP ^7.4

2.0.0PHP ^8.1

2.1.0PHP ^8.3

2.x-devPHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/147145?v=4)[Cees-Jan Kiewiet](/maintainers/WyriHaximus)[@WyriHaximus](https://github.com/WyriHaximus)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (76 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (28 commits)")[![reactphp-parallel-renovate-runner[bot]](https://avatars.githubusercontent.com/u/56447449?v=4)](https://github.com/reactphp-parallel-renovate-runner[bot] "reactphp-parallel-renovate-runner[bot] (13 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")

---

Tags

hacktoberfest

### Embed Badge

![Health badge](/badges/react-parallel-event-loop/health.svg)

```
[![Health](https://phpackages.com/badges/react-parallel-event-loop/health.svg)](https://phpackages.com/packages/react-parallel-event-loop)
```

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

43.2k341.0k1](/packages/ccxt-ccxt)[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.2k](/packages/friendsofphp-php-cs-fixer)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k420.9k26](/packages/team-reflex-discord-php)[react/react

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

9.1k3.7M64](/packages/react-react)[internal/dload

Downloads binaries.

102212.2k19](/packages/internal-dload)

PHPackages © 2026

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