Example #1
0
<?php

namespace nats;

include_once 'lib/NATSClient.php';
$client = new NATSClient();
$client->subscribe('nano', [], function ($message) {
    echo "{$message}";
});
$client->listen();
Example #2
0
<?php

namespace nats;

include_once 'lib/NATSClient.php';
$client = new NATSClient();
$client->publish("nano", "Here forever!");
Example #3
0
<?php

namespace nats;

include_once 'lib/NATSClient.php';
$client = new NATSClient();
$client->publish("nano", "Here forever!");
$client->subscribe("nano", [], function ($message, $reply, $sub) {
    echo "Received message:{$message}|{$reply}|{$sub}\n";
});
$client->listen();