Skip to content

Commit 5f5f128

Browse files
Readme clarifications [ci skip].
1 parent b2eff71 commit 5f5f128

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Greenkeeper monitoring](https://img.shields.io/badge/dependencies-monitored-brightgreen.svg)](https://greenkeeper.io/) [![Travis build status](https://img.shields.io/travis/zeromq/zeromq.js.svg)](https://travis-ci.org/zeromq/zeromq.js)
44

5-
## ⚠️⚠️⚠️ This is work in progress and published only as a beta version. For the current stable version see the [5.x branch](https://github.com/zeromq/zeromq.js/tree/5.x) ⚠️⚠️⚠️
5+
## ⚠️⚠️⚠️ This is work in progress and published as a beta version. For the current stable version see the [5.x branch](https://github.com/zeromq/zeromq.js/tree/5.x) ⚠️⚠️⚠️
66

77
[ØMQ](http://zeromq.org) bindings for Node.js. The goals of this library are:
88
* Semantically similar to the [native](https://github.com/zeromq/libzmq) ØMQ library, while sticking to JavaScript idioms.
@@ -26,7 +26,7 @@
2626
Install ZeroMQ.js with prebuilt binaries:
2727

2828
```sh
29-
npm install zeromq@6.0.0-beta.1
29+
npm install zeromq
3030
```
3131

3232
Requirements for prebuilt binaries:
@@ -44,13 +44,13 @@ If a prebuilt binary is not available for your platform, installing will attempt
4444
If you want to link against a shared ZeroMQ library, you can build and link with the shared library as follows:
4545

4646
```sh
47-
npm install zeromq@6.0.0-beta.1 --zmq-shared
47+
npm install zeromq --zmq-shared
4848
```
4949

5050
If you wish to use any DRAFT sockets then it is also necessary to compile the library from source:
5151

5252
```sh
53-
npm install zeromq@6.0.0-beta.1 --zmq-draft
53+
npm install zeromq --zmq-draft
5454
```
5555

5656
Make sure you have the following installed before attempting to build from source:
@@ -81,7 +81,7 @@ async function run() {
8181
await sock.bind("tcp://127.0.0.1:3000")
8282
console.log("Producer bound to port 3000")
8383

84-
while (!sock.closed) {
84+
while (true) {
8585
await sock.send("some work")
8686
await new Promise(resolve => setTimeout(resolve, 500))
8787
}
@@ -101,8 +101,7 @@ async function run() {
101101
sock.connect("tcp://127.0.0.1:3000")
102102
console.log("Worker connected to port 3000")
103103

104-
while (!sock.closed) {
105-
const [msg] = await sock.receive()
104+
for await (const [msg] of sock) {
106105
console.log("work: %s", msg.toString())
107106
}
108107
}
@@ -127,7 +126,7 @@ async function run() {
127126
await sock.bind("tcp://127.0.0.1:3000")
128127
console.log("Publisher bound to port 3000")
129128

130-
while (!sock.closed) {
129+
while (true) {
131130
console.log("sending a multipart message envelope")
132131
await sock.send(["kitty cats", "meow!"])
133132
await new Promise(resolve => setTimeout(resolve, 500))
@@ -149,8 +148,7 @@ async function run() {
149148
sock.subscribe("kitty cats")
150149
console.log("Subscriber connected to port 3000")
151150

152-
while (!sock.closed) {
153-
const [topic, msg] = await sock.receive()
151+
for await (const [topic, msg] of sock) {
154152
console.log("received a message related to:", topic, "containing message:", msg)
155153
}
156154
}

0 commit comments

Comments
 (0)