PHPackages                             stefanotorresi/influxdb-php-async - 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. [Database &amp; ORM](/categories/database)
4. /
5. stefanotorresi/influxdb-php-async

ActiveLibrary[Database &amp; ORM](/categories/database)

stefanotorresi/influxdb-php-async
=================================

Async PHP client for InfluxDB

0.5.0(8y ago)11859↓100%4MITPHPPHP ^7.1

Since Feb 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/stefanotorresi/influxdb-php-async)[ Packagist](https://packagist.org/packages/stefanotorresi/influxdb-php-async)[ RSS](/packages/stefanotorresi-influxdb-php-async/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (5)Versions (6)Used By (0)

InfluxDB PHP Async
==================

[](#influxdb-php-async)

An asyncronous client for [InfluxDB](https://github.com/influxdata/influxdb), implemented via [ReactPHP](http://reactphp.org).

[![Build Status](https://camo.githubusercontent.com/65a528d21b614dd32286726ce155615de0f45f952c1563ad4168606a6afd1004/68747470733a2f2f7472617669732d63692e6f72672f73746566616e6f746f72726573692f696e666c757864622d7068702d6173796e632e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/stefanotorresi/influxdb-php-async)[![Latest Stable Version](https://camo.githubusercontent.com/972ad0bff6ba83be54b10ad19ef1a00e98e3f6c0cc55078979769c3c67d36509/68747470733a2f2f706f7365722e707567782e6f72672f73746566616e6f746f72726573692f696e666c757864622d7068702d6173796e632f76657273696f6e)](https://packagist.org/packages/stefanotorresi/influxdb-php-async)[![License](https://camo.githubusercontent.com/7c050f321cfe0a2dbd61892abd1f4ce9c366fb12c0752c357c56d0aebe61f771/68747470733a2f2f706f7365722e707567782e6f72672f73746566616e6f746f72726573692f696e666c757864622d7068702d6173796e632f6c6963656e7365)](https://packagist.org/packages/stefanotorresi/influxdb-php-async)

### Installation

[](#installation)

Use [Composer](https://getcomposer.org)

`composer require stefanotorresi/influxdb-php-async`

### Usage

[](#usage)

Each client implementation exposes three main methods:

```
interface AsyncClient
{
    public function query(string $query, array $params = []): Promise;
    public function write(string $payload, array $params = []): Promise;
    public function ping(): Promise;
    /* etc. */
}
```

The default implementation uses [Buzz React](https://github.com/clue/php-buzz-react) and we'll use it throughout the rest of this document.

Here is a basic usage example where we first create a database, then write a line to it:

```
$client = new ReactHttpClient();

$client
    ->query('CREATE DATABASE test')
    ->then(function($response) use ($client) {
        return $client->write('measure,tag="foo" value="bar"', ['db' => 'test']);
    })
    ->done()
;

$client->run();
```

Note that you need to run the ReactPHP event loop. If you don't inject your own, a default loop is composed by the client, and can be started via the `run` method.

This API assumes that you're familiar with [ReactPHP promises](https://github.com/reactphp/promise).

#### Configuration

[](#configuration)

These are the default options:

```
[
    'host'           => 'localhost',
    'port'           => 8086,
    'database'       => '',
    'username'       => '',
    'password'       => '',
    'socket_options' => [],
];
```

You can change them at instantion time, defaults will be merged with the one passed:

```
$options = [
    'host' => 'influx-db.domain.tld',
    'socket_options' => [
        'tls' => true,
    ],
];

$client = new ReactHttpClient($options);
```

For details about the `socket_options` key, please refer to [react/socket documentation](https://github.com/reactphp/socket#connector).

### Future developments / TO-DO list

[](#future-developments--to-do-list)

- An UDP client implemented with [react/datagram](https://github.com/reactphp/datagram).
- A QueryBuilder, possibly identical to the one in the [official influxdb-php client](https://github.com/influxdata/influxdb-php).
- A set of response decoders that convert the JSON body from PSR-7 Responses to something more readily consumable.
- Explore the possibility of merging this package into the official sdk.

### License

[](#license)

This package is released under the [MIT](https://github.com/stefanotorresi/influxdb-php-async/blob/master/LICENSE) license.

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.5% 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 ~59 days

Total

5

Last Release

3080d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbe15d47dd8509ff2f5b24bb02e4d271689242ab2e5608d0f67259e277491a9a?d=identicon)[stefanotorresi](/maintainers/stefanotorresi)

---

Top Contributors

[![stefanotorresi](https://avatars.githubusercontent.com/u/2952427?v=4)](https://github.com/stefanotorresi "stefanotorresi (39 commits)")[![marcvdm](https://avatars.githubusercontent.com/u/1028066?v=4)](https://github.com/marcvdm "marcvdm (1 commits)")

---

Tags

guzzleinfluxdbphpreactphp

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/stefanotorresi-influxdb-php-async/health.svg)

```
[![Health](https://phpackages.com/badges/stefanotorresi-influxdb-php-async/health.svg)](https://phpackages.com/packages/stefanotorresi-influxdb-php-async)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k280.5M5.6k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k114.4M86](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k51.5M8.2k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k62.7M499](/packages/mongodb-mongodb)[spatie/laravel-translatable

A trait to make an Eloquent model hold translations

2.4k22.1M350](/packages/spatie-laravel-translatable)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.5k23.2M26](/packages/kirschbaum-development-eloquent-power-joins)

PHPackages © 2026

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