예제 #1
0
<?php

require_once __DIR__ . "/../vendor/autoload.php";
$connectionOptions = new \Nats\ConnectionOptions();
$connectionOptions->setHost('localhost')->setPort(4222)->setUser("foo")->setPass("bar");
$c = new Nats\Connection($connectionOptions);
$c->connect();
$c->close();
예제 #2
0
파일: pub.php 프로젝트: olivermack/phpnats
<?php

require_once __DIR__ . "/../../vendor/autoload.php";
$connectionOptions = new \Nats\ConnectionOptions();
$connectionOptions->setHost('localhost')->setPort(4222);
$c = new Nats\Connection($connectionOptions);
$c->connect();
$c->reconnect();
$c->publish("foo", "bar");
$c->publish("foo", "bar");
$c->publish("foo", "bar");
$c->publish("foo", "bar");
$c->publish("foo", "bar");
예제 #3
0
파일: ping.php 프로젝트: olivermack/phpnats
<?php

require_once __DIR__ . "/../vendor/autoload.php";
$connectionOptions = new \Nats\ConnectionOptions();
$connectionOptions->setHost('localhost')->setPort(4222);
echo "Server: nats://" . $connectionOptions->getHost() . ":" . $connectionOptions->getPort() . PHP_EOL;
$c = new Nats\Connection($connectionOptions);
$c->connect();
$c->ping();