Beispiel #1
0
<?php

namespace nats;

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

namespace nats;

include_once 'lib/NATSClient.php';
$client = new NATSClient();
$client->publish("nano", "Here forever!");
Beispiel #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();