PHPackages                             thomasvargiu/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. [HTTP &amp; Networking](/categories/http)
4. /
5. thomasvargiu/influxdb-php-async

ActiveLibrary[HTTP &amp; Networking](/categories/http)

thomasvargiu/influxdb-php-async
===============================

Async PHP client for InfluxDB

0.5.0(4y ago)0107MITPHPPHP ^7.4 || ^8.0

Since Feb 22Pushed 4y ago1 watchersCompare

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

READMEChangelogDependencies (4)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).

> This is a fork of [stefanotorresi/influxdb-php-async](https://github.com/stefanotorresi/influxdb-php-async)

### Installation

[](#installation)

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

`composer require thomasvargiu/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 `react/http` 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/thomasvargiu/influxdb-php-async/blob/master/LICENSE) license.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 90.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 ~472 days

Total

5

Last Release

1530d ago

PHP version history (2 changes)0.1.0PHP ^7.1

0.5.0PHP ^7.4 || ^8.0

### Community

Maintainers

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

---

Top Contributors

[![stefanotorresi](https://avatars.githubusercontent.com/u/2952427?v=4)](https://github.com/stefanotorresi "stefanotorresi (38 commits)")[![thomasvargiu](https://avatars.githubusercontent.com/u/732012?v=4)](https://github.com/thomasvargiu "thomasvargiu (4 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

###  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)[discord-php/http

Handles HTTP requests to Discord servers

24360.3k12](/packages/discord-php-http)[clue/soap-react

Simple, async SOAP webservice client library, built on top of ReactPHP

64123.7k2](/packages/clue-soap-react)[rx/websocket

Websockets for PHP using Rx

35182.6k2](/packages/rx-websocket)[php-http/react-adapter

React HTTP Adapter

19267.7k4](/packages/php-http-react-adapter)[voryx/websocketmiddleware

WebSocket Middleware for React

2669.4k3](/packages/voryx-websocketmiddleware)

PHPackages © 2026

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