1.0.2 • Published 8 years ago

zookeeper-reconnect v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

zookeeper-reconnect

A zookeeper client that automatically reconnects on session timeouts

Usage

var Zookeeper = require('zookeeper-reconnect');
var zk = new Zookeeper ('your zookeeper connection string', options);

zk.on('connected', function(client){
  //You are now connected to ZK
  //It will be called the first time you connect to ZK and when reconnecting
  //after disconnection or session loss.

  client.getData('/path', watchHandler, function(err, data){
    // work with your ZK data
  })
})

//You could also use it outside the callback
if (zk.connected){
  zk.client.getData(function('/path', watchHandler, function(err, data){
    //Work with your ZK data
  });
}
1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago