forked from interpretor/zyre.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5310c8d
commit ba70c63
Showing
18 changed files
with
322 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,44 @@ | ||
# zre | ||
# zyre.js | ||
|
||
[![Build Status](https://travis-ci.org/interpretor/zyre.js.svg?branch=master)](https://travis-ci.org/interpretor/zyre.js) | ||
|
||
Implementation of ZRE (http://rfc.zeromq.org/spec:36/ZRE) in node.js | ||
Node.js port of [Zyre](https://github.com/zeromq/zyre) - an open-source framework for proximity-based peer-to-peer applications | ||
|
||
## Notice | ||
|
||
This project is currently in development and not considered stable yet. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install zyre.js | ||
``` | ||
|
||
## Examples | ||
|
||
```js | ||
const zyre = require('zyre.js'); | ||
|
||
const z1 = zyre.new(); | ||
const z2 = zyre.new(); | ||
|
||
z1.on('message', (name, message, group) => { | ||
console.log(`#${group} <${name}> ${message}`); | ||
z1.shout('CHAT', 'Hey!'); | ||
}); | ||
|
||
z2.on('message', (name, message, group) => { | ||
console.log(`#${group} <${name}> ${message}`); | ||
}); | ||
|
||
z1.start().then(() => { | ||
z1.join('CHAT'); | ||
z2.start().then(() => { | ||
z2.join('CHAT'); | ||
}); | ||
}); | ||
|
||
setInterval(() => { | ||
z2.shout('CHAT', 'Hello World!'); | ||
}, 1000); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.