PHPackages                             wpjscc/reactphp-mysql-pool - 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. wpjscc/reactphp-mysql-pool

ActiveLibrary

wpjscc/reactphp-mysql-pool
==========================

v1.0.5(2y ago)16412PHP

Since Oct 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/wpjscc/reactphp-mysql-pool)[ Packagist](https://packagist.org/packages/wpjscc/reactphp-mysql-pool)[ RSS](/packages/wpjscc-reactphp-mysql-pool/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (2)

reactphp-mysql-pool
===================

[](#reactphp-mysql-pool)

```
    +----------------+
    |   connect pool --------------------------> mysql server
    |       |        |
    |       |        |
    |       |        |
    |       app      |
    +----------------+

```

install
-------

[](#install)

```
composer require wpjscc/reactphp-mysql-pool -vvv

```

example
-------

[](#example)

```
require_once './vendor/autoload.php';

use Wpjscc\MySQL\Pool;
use React\MySQL\QueryResult;
use React\EventLoop\Loop;

$pool = new Pool('username:password@host/databasename?timeout=5', [
    'min_connections' => 2, // min 2 connection
    'max_connections' => 10, // max 10 connection
    'max_wait_queue' => 110, // how many sql in queue
    'wait_timeout' => 5,// wait time include response time
    'keep_alive' => 60, //
]);

qeury($pool);
queryStream($pool);

function qeury($pool) {
    for ($i=0; $i < 90; $i++) {
        $pool->query('select * from blog')->then(function (QueryResult $command) use ($i) {
            echo "query:$i\n";
            if (isset($command->resultRows)) {
                // this is a response to a SELECT etc. with some rows (0+)
                // print_r($command->resultFields);
                // print_r($command->resultRows);
                echo count($command->resultRows) . ' row(s) in set' . PHP_EOL;
            } else {
                // this is an OK message in response to an UPDATE etc.
                if ($command->insertId !== 0) {
                    var_dump('last insert ID', $command->insertId);
                }
                echo 'Query OK, ' . $command->affectedRows . ' row(s) affected' . PHP_EOL;
            }
        }, function (\Exception $error) {
            // the query was not executed successfully
            echo 'Error: ' . $error->getMessage() . PHP_EOL;
        });

    }
}

function queryStream($pool){
    for ($i=0; $i < 90; $i++) {
        (function($pool,$i){
            $stream = $pool->queryStream('select * from blog');

            $stream->on('data', function ($data) use ($i) {
                // echo "queryStream:$i\n";
                // print_r($data);
            });
            $stream->on('error', function ($err) {
                echo 'Error: ' . $err->getMessage() . PHP_EOL;
            });
            $stream->on('end', function () use ($i) {
                echo 'Completed.'.$i . PHP_EOL;
            });

        })($pool, $i);

    }
}

Loop::addPeriodicTimer(5, function() use ($pool) {
    // qeury($pool);
    // queryStream($pool);
});

$pool->translation(function($connection){
    $connection->query("INSERT INTO blog_test (content) VALUES ('hello world success')");
    // throw new Exception("Error Processing Request", 1);
})->then(function($result){
    var_dump($result);
}, function($error){
    var_dump($error->getMessage());
});

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity47

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

Total

6

Last Release

908d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/76907477?v=4)[wpjscc](/maintainers/wpjscc)[@wpjscc](https://github.com/wpjscc)

---

Top Contributors

[![wpjscc](https://avatars.githubusercontent.com/u/76907477?v=4)](https://github.com/wpjscc "wpjscc (13 commits)")

### Embed Badge

![Health badge](/badges/wpjscc-reactphp-mysql-pool/health.svg)

```
[![Health](https://phpackages.com/badges/wpjscc-reactphp-mysql-pool/health.svg)](https://phpackages.com/packages/wpjscc-reactphp-mysql-pool)
```

###  Alternatives

[ccxt/ccxt

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

41.5k328.9k1](/packages/ccxt-ccxt)[react/react

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

9.1k3.6M63](/packages/react-react)[team-reflex/discord-php

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

1.1k379.4k24](/packages/team-reflex-discord-php)[clue/framework-x

Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

936736.7k8](/packages/clue-framework-x)[web3p/web3.php

Ethereum web3 interface.

1.3k325.5k41](/packages/web3p-web3php)[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)

PHPackages © 2026

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