Addressbook keeps tracking available node instances backed by Redis.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
test
.gitignore
README.md
index.js
package.json

README.md

addressbook

addressbook keeps tracking available node instances backed by Redis.

Prerequisites

Redis >=2.6.4.

On Mac with homebrew,

$ homebrew install redis
$ redis-server

Installation

$ npm install addressbook

Version

0.0.1 (pre-release)

Usage

var AB = require('addressbook');
var ab = new AB();
var myServicies = [{port: 3000, protocol: 'http'}, {port: 5004, protocol: 'dnode'}];
ab.update(myServicies, function(err, addressbook) {
  if (err) {
    throw err;
  } else {
    console.log(addressbook);
  }
});
ab.pick(); // => return a randomly picked remote service

API

ab.([port], [host], [options], [passowrd])

ab.update([myServicies], [callback])

ab.pick()

Test

$ npm test

License

MIT

Copyright (c) 2012 Kazuyuki Tanimura