Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit b203825

Browse files
author
Raül Pérez
committed
Merge branch 'release/0.0.7'
2 parents 7d80efb + e616d93 commit b203825

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.6
1+
0.0.7

examples/pubsub/sub.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
const HOST = "localhost";
55
const PORT = 4222;
66

7-
$c = new Nats\Connection(HOST, PORT);
7+
$c = new Nats\Connection();
88
$c->connect();
99

1010
$callback = function ($payload) {
@@ -13,4 +13,6 @@
1313

1414
$sid = $c->subscribe("foo", $callback);
1515

16-
$c->wait();
16+
$c->wait(2);
17+
18+
$c->unsubscribe($sid);

src/Connection.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,7 @@ public function ping()
204204
public function publish($subject, $payload)
205205
{
206206
$msg = 'PUB '.$subject.' '.strlen($payload);
207-
$this->send($msg);
208-
$this->send($payload);
207+
$this->send($msg . "\r\n" . $payload);
209208
$this->pubs += 1;
210209
}
211210

0 commit comments

Comments
 (0)