Skip to content

Commit

Permalink
Add callback to Discover constructor signature docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wankdanker committed Nov 11, 2016
1 parent 7918499 commit 04847b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Constructor
-----------

```js
Discover(opts)
Discover(opts, callback)
```
* opts - object
* **helloInterval** : How often to broadcast a hello packet in milliseconds
Expand Down
7 changes: 7 additions & 0 deletions examples/basic-argv.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ delete argv.$0;

var d = new Discover(argv);

console.log('d.me:' , d.me);
console.log('instanceUuid', d.broadcast.instanceUuid);
console.log('processUuid', d.broadcast.processUuid);
d.advertise({ testing : Math.random() });

d.on("added", function (obj) {
console.log("New node added to the network.");
console.log(obj);
Expand All @@ -29,3 +34,5 @@ d.on("removed", function (obj) {
d.on("error", function (err) {
console.log("error", err);
});

module.exports = d;

0 comments on commit 04847b7

Please sign in to comment.