PHPackages                             mkusher/react-co - 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. mkusher/react-co

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

mkusher/react-co
================

Simple reactphp coroutines

84.4kPHP

Since Aug 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mkusher/reactphp-co)[ Packagist](https://packagist.org/packages/mkusher/react-co)[ RSS](/packages/mkusher-react-co/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Reactphp Co
===========

[](#reactphp-co)

[![Build Status](https://camo.githubusercontent.com/62472216146ba899459b6fba8ae14cf4caba674f4e62f334a927a887b94de1ad/68747470733a2f2f7472617669732d63692e6f72672f6d6b75736865722f72656163747068702d636f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mkusher/reactphp-co)

Simple coroutines for your reactphp applications.

Installation
============

[](#installation)

Use composer to install this package

```
composer require mkusher/react-co

```

Coroutines
==========

[](#coroutines)

Don't know what coroutines are? Read this [awesome article by Nikita Popov](http://nikic.github.io/2012/12/22/Cooperative-multitasking-using-coroutines-in-PHP.html)

Examples
========

[](#examples)

Basic example where `asyncOp1` and `asyncOp2` your asynchronous functions that return instance of PromiseInterface.

```
use Mkusher\Co;

Co\await(function() {
    $a = yield asyncOp1();
    $b = yield asyncOp2($a);
});
```

`await` returns Promise, so that you can wait for all your operatoins to complete like:

```
use Mkusher\Co;

Co\await(function() {
    $a = yield asyncOp1();
    return "10";
})->then(function($result) {
    echo $result;
});
```

This example will write "10" after executing `asyncOp1`.

You can find more examples in [examples dir](https://github.com/mkusher/reactphp-co/blob/master/examples/)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![mkusher](https://avatars.githubusercontent.com/u/523021?v=4)](https://github.com/mkusher "mkusher (3 commits)")

### Embed Badge

![Health badge](/badges/mkusher-react-co/health.svg)

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

###  Alternatives

[rackbeat/php-throttler

Throttle PHP function calls and iteration runs by X executions per second.

1136.3k](/packages/rackbeat-php-throttler)

PHPackages © 2026

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