PHPackages                             icicleio/react-adapter - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. icicleio/react-adapter

ArchivedLibrary[Queues &amp; Workers](/categories/queues)

icicleio/react-adapter
======================

Adapts the event loop and promises of Icicle to interfaces compatible with components built for React.

v0.4.0(10y ago)74071MITPHP

Since Apr 2Pushed 10y ago3 watchersCompare

[ Source](https://github.com/icicleio/react-adapter)[ Packagist](https://packagist.org/packages/icicleio/react-adapter)[ Docs](http://icicle.io)[ RSS](/packages/icicleio-react-adapter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (7)Used By (0)

React Adapter for Icicle
========================

[](#react-adapter-for-icicle)

[![@icicleio on Twitter](https://camo.githubusercontent.com/fb16a2e03bb85dd9926a15e837d3754b7766046281e2698271930aadbcd972cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f747769747465722d253430696369636c65696f2d3531383963372e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/icicleio)[![Build Status](https://camo.githubusercontent.com/564a5801b30a08c08a4a083a8fb4fd62099a6b365f377cf3dee0f8ed6bf691f7/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f696369636c65696f2f72656163742d616461707465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/icicleio/react-adapter)[![Coverage Status](https://camo.githubusercontent.com/39c93237bd7afb55683c92a1515f3227d3b696a6e8807d2277167e250f8102ea/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f696369636c65696f2f72656163742d616461707465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/icicleio/react-adapter)[![Semantic Version](https://camo.githubusercontent.com/dd67eedd2542c80b44cd4d9aac2ab719904a38d2bae8b5c52e0894e7d73ccd25/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f696369636c65696f2f72656163742d616461707465722e7376673f7374796c653d666c61742d737175617265)](http://semver.org)[![MIT License](https://camo.githubusercontent.com/c63b1c91d52927ac115856efe89ab409cef5f3960f8badfda9e83151ed359e24/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f696369636c65696f2f72656163742d616461707465722e7376673f7374796c653d666c61742d737175617265)](LICENSE)

This library facilitates interoperability between components built for [React](http://reactphp.org) and [Icicle](http://icicle.io). This library provides an adapter between the differing event loop and promise implementations of the two libraries.

##### Requirements

[](#requirements)

- PHP 5.5+

##### Installation

[](#installation)

The recommended way to install is with the [Composer](http://getcomposer.org/) package manager. (See the [Composer installation guide](https://getcomposer.org/doc/00-intro.md) for information on installing and using Composer.)

Run the following command to use this library in your project:

```
composer require icicleio/react-adapter
```

You can also manually edit `composer.json` to add this library as a project requirement.

```
// composer.json
{
    "require": {
        "icicleio/react-adapter": "^0.4"
    }
}
```

ReactLoop
---------

[](#reactloop)

`Icicle\ReactAdapter\Loop\ReactLoop` is as a direct replacement for the React event loop. It communicates with the active Icicle event loop to provide the same functionality. The class implements `React\EventLoop\LoopInterface`, so it can be used with any component that requires a React event loop.

```
use Icicle\ReactAdapter\Loop\ReactLoop;
use Predis\Async\Client;

// Create the loop adapter.
$loop = new ReactLoop();

// $loop can be used anywhere an instance of React\EventLoop\LoopInterface is required.
$client = new Client('tcp://127.0.0.1:6379', $loop);
```

ReactPromise
------------

[](#reactpromise)

`Icicle\ReactAdapter\Promise\ReactPromise` creates a promise implementing `React\Promise\ExtendedPromiseInterface` and `React\Promise\ExtendedPromiseInterface` from an Icicle awaitable that implements `Icicle\Awaitable\Awaitable`. This allows awaitables created from Icicle to be used in any component requiring a React promise.

```
$iciclePromise = new \Icicle\Awaitable\Promise(function ($resolve, $reject) {
    // Resolver
});

$reactPromise = new \Icicle\ReactAdapter\Promise\ReactPromise($iciclePromise);
```

Awaitable\\adapt()
------------------

[](#awaitableadapt)

The `Icicle\Awaitable` namespace defines a function `adapt()` that can transform any object with a `then(callable $onFulfilled, callable $onRejected)` method into an awaitable implementing `Icicle\Awaitable\Awaitable`. This function can be used to convert a React promise to an Icicle awaitable.

```
$reactPromise = new \React\Promise\Promise(function ($resolve, $reject) {
    // Resolver
});

$awaitable = \Icicle\Awaitable\adapt($reactPromise);
```

See the [Awaitable API documentation](//github.com/icicleio/icicle/wiki/Awaitables) for more information on `Icicle\Awaitable\adapt()`.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

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

Total

6

Last Release

3815d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1628287?v=4)[Aaron Piotrowski](/maintainers/Trowski)[@trowski](https://github.com/trowski)

---

Top Contributors

[![trowski](https://avatars.githubusercontent.com/u/1628287?v=4)](https://github.com/trowski "trowski (21 commits)")

---

Tags

promiseadapterloop

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/icicleio-react-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/icicleio-react-adapter/health.svg)](https://phpackages.com/packages/icicleio-react-adapter)
```

###  Alternatives

[amphp/amp

A non-blocking concurrency framework for PHP applications.

4.4k123.4M323](/packages/amphp-amp)[react/promise

A lightweight implementation of CommonJS Promises/A for PHP

2.5k361.9M563](/packages/react-promise)[php-http/promise

Promise used for asynchronous HTTP requests

1.8k308.8M32](/packages/php-http-promise)[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[react/promise-timer

A trivial implementation of timeouts for Promises, built on top of ReactPHP.

34141.9M96](/packages/react-promise-timer)[sabre/event

sabre/event is a library for lightweight event-based programming

35227.4M25](/packages/sabre-event)

PHPackages © 2026

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