{"id":15563299,"url":"https://github.com/stefanotorresi/influxdb-php-async","last_synced_at":"2025-10-24T16:50:32.556Z","repository":{"id":57059553,"uuid":"82790317","full_name":"stefanotorresi/influxdb-php-async","owner":"stefanotorresi","description":"An asyncronous client for InfluxDB, implemented via ReactPHP.","archived":false,"fork":false,"pushed_at":"2018-01-19T14:46:12.000Z","size":96,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-18T11:42:34.486Z","etag":null,"topics":["guzzle","influxdb","php","reactphp"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefanotorresi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-22T10:11:50.000Z","updated_at":"2020-04-26T15:20:02.000Z","dependencies_parsed_at":"2022-08-24T04:23:03.425Z","dependency_job_id":null,"html_url":"https://github.com/stefanotorresi/influxdb-php-async","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanotorresi%2Finfluxdb-php-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanotorresi%2Finfluxdb-php-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanotorresi%2Finfluxdb-php-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefanotorresi%2Finfluxdb-php-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefanotorresi","download_url":"https://codeload.github.com/stefanotorresi/influxdb-php-async/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250529617,"owners_count":21445655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["guzzle","influxdb","php","reactphp"],"created_at":"2024-10-02T16:21:13.334Z","updated_at":"2025-10-24T16:50:32.499Z","avatar_url":"https://github.com/stefanotorresi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# InfluxDB PHP Async\n \n An asyncronous client for [InfluxDB][InfluxDB], implemented via [ReactPHP][ReactPHP].\n \n [![Build Status](https://travis-ci.org/stefanotorresi/influxdb-php-async.svg?branch=master)](https://travis-ci.org/stefanotorresi/influxdb-php-async)\n [![Latest Stable Version](https://poser.pugx.org/stefanotorresi/influxdb-php-async/version)](https://packagist.org/packages/stefanotorresi/influxdb-php-async)\n [![License](https://poser.pugx.org/stefanotorresi/influxdb-php-async/license)](https://packagist.org/packages/stefanotorresi/influxdb-php-async)\n\n### Installation\n\nUse [Composer][Composer]\n\n`composer require stefanotorresi/influxdb-php-async`\n\n### Usage\n\nEach client implementation exposes three main methods:\n \n```php\ninterface AsyncClient\n{\n    public function query(string $query, array $params = []): Promise;\n    public function write(string $payload, array $params = []): Promise;\n    public function ping(): Promise;\n    /* etc. */\n}\n```\n\nThe default implementation uses [Buzz React][Buzz React] and we'll use it throughout the rest of this document. \n\nHere is a basic usage example where we first create a database, then write a line to it:\n\n```php\n$client = new ReactHttpClient();\n\n$client\n    -\u003equery('CREATE DATABASE test')\n    -\u003ethen(function($response) use ($client) {\n        return $client-\u003ewrite('measure,tag=\"foo\" value=\"bar\"', ['db' =\u003e 'test']);\n    })\n    -\u003edone()\n;\n\n$client-\u003erun();\n```\n\nNote 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.\n\nThis API assumes that you're familiar with [ReactPHP promises][ReactPHP promises].\n\n#### Configuration\n\nThese are the default options:\n\n```php\n[\n    'host'           =\u003e 'localhost',\n    'port'           =\u003e 8086,\n    'database'       =\u003e '',\n    'username'       =\u003e '',\n    'password'       =\u003e '',\n    'socket_options' =\u003e [],\n];\n```\n\nYou can change them at instantion time, defaults will be merged with the one passed:\n\n```php\n$options = [ \n    'host' =\u003e 'influx-db.domain.tld', \n    'socket_options' =\u003e [\n        'tls' =\u003e true,\n    ],   \n];\n\n$client = new ReactHttpClient($options);\n```\n\nFor details about the `socket_options` key, please refer to [react/socket documentation]. \n\n### Future developments / TO-DO list\n\n- An UDP client implemented with [react/datagram](https://github.com/reactphp/datagram).\n- A QueryBuilder, possibly identical to the one in the [official influxdb-php client].\n- A set of response decoders that convert the JSON body from PSR-7 Responses to something more readily consumable.\n- Explore the possibility of merging this package into the official sdk.\n\n### License\n\nThis package is released under the [MIT](https://github.com/stefanotorresi/influxdb-php-async/blob/master/LICENSE) license.\n\n\n[InfluxDB]: https://github.com/influxdata/influxdb\n[ReactPHP]: http://reactphp.org\n[Composer]: https://getcomposer.org\n[Buzz React]: https://github.com/clue/php-buzz-react\n[ReactPHP promises]: https://github.com/reactphp/promise\n[official influxdb-php client]: https://github.com/influxdata/influxdb-php\n[react/socket documentation]: https://github.com/reactphp/socket#connector\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanotorresi%2Finfluxdb-php-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefanotorresi%2Finfluxdb-php-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefanotorresi%2Finfluxdb-php-async/lists"}