PHP code example of apntalk / ami-client

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

    

apntalk / ami-client example snippets


use Apn\AmiClient\Cluster\AmiClientManager;
use Apn\AmiClient\Protocol\Ping;

$manager = app(AmiClientManager::class);
$manager->default()->send(new Ping());

use Apn\AmiClient\Cluster\AmiClientManager;
use Apn\AmiClient\Protocol\GenericAction;

app(AmiClientManager::class)
    ->server('node_1')
    ->send(new GenericAction('QueueSummary', ['Queue' => 'support']));

use Apn\AmiClient\Cluster\ConfigLoader;
use Psr\Log\NullLogger;

$config =     $manager->tickAll(25); // bounded selector wait (ms), avoids hot-spin
}