PHP code example of truesocialmetrics / gearman-stats

1. Go to this page and download the library: Download truesocialmetrics/gearman-stats 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/ */

    

truesocialmetrics / gearman-stats example snippets


$adapter = new \TweeGearmanStat\Queue\Gearman(array(
    'h1' => array('host' => '10.0.0.1', 'port' => 4730, 'timeout' => 1),
    'h2' => array('host' => '10.0.0.2', 'port' => 4730, 'timeout' => 1),
));
$status = $adapter->status();
var_dump($status);

$adapter = new \TweeGearmanStat\Queue\Gearman(array(
    'h1' => array('host' => '10.0.0.1', 'port' => 4730),
    'h2' => array('host' => '10.0.0.2', 'port' => 4730),
));
$status = $adapter->status();
var_dump($status);
bash
$ php composer.phar update