PHP code example of sroze / discoverd-client

1. Go to this page and download the library: Download sroze/discoverd-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sroze / discoverd-client example snippets




use SRIO\Discoverd\Client;

// Create the Discoverd client
$client = new Client();

// Get informations about the service named "pg"
$serviceName = 'pg';
$result = $client->subscribe($serviceName);

// You can also call any method on RPC server
$client->call('Agent.Register', array(
    'Name' => 'anyservice',
    'Addr' => '1.2.3.4:5678'
));