Download the PHP package migratorydata/migratorydata-client-reactphp without Composer
On this page you can find all versions of the php package migratorydata/migratorydata-client-reactphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download migratorydata/migratorydata-client-reactphp
More information about migratorydata/migratorydata-client-reactphp
Files in migratorydata/migratorydata-client-reactphp
Package migratorydata-client-reactphp
Short Description MigratoryData Client API for React PHP
License proprietary
Homepage https://github.com/migratorydata/migratorydata-client-reactphp
Informations about the package migratorydata-client-reactphp
MigratoryData Client for ReactPHP 5.x & 6.x
Below you can find a tutorial and usage example. For more information please refer to MigratoryData Documentation 6.x.
Usage
Install the MigratoryData client library 5.x using composer (MigratoryData client version 5 can be used with MigratoryData Server 5.0.*):
Install the MigratoryData client library 6.x using composer (MigratoryData client version 6 can be used with the MigratoryData server 6.0.1 or later):
Import classes and define MigratoryData callback listener:
Create the event loop:
Create a MigratoryData client and attach the event loop:
Initialize and connect the MigratoryData client:
Publish a message every second to MigratoryData server:
Start the event loop:
Example client application
Copy the code below to a file named echo-time-client.php
and run it using the following command:
Example for PHP React Client API
The client application connects to the MigratoryData server deployed at localhost:8800
subscribes and publishes a message every second on the subject /server/status
.
If you don't have a MigratoryData server installed on your machine but there is docker installed you can run the following command to start MigratoryData server, otherwise you can download and install the latest version for your os from here.