addressbook

Addressbook keeps tracking available node instances backed by Redis.

addressbook

addressbook keeps tracking available node instances backed by Redis.

Redis >=2.6.4.

On Mac with homebrew,

$ homebrew install redis
$ redis-server
$ npm install addressbook
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(erraddressbook) {
  if (err) {
    throw err;
  } else {
    console.log(addressbook);
  }
});
ab.pick(); // => return a randomly picked remote service 

API

Test

$ npm test

License

MIT

Copyright (c) 2012 Kazuyuki Tanimura