0.0.2 • Published 9 years ago

mlsc-zookeeper v0.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
9 years ago
var zookeeper = require('./index.js');
var client;
function createClient(){
    var client = zookeeper.createClient('192.168.252.131:2181/watchTest');
    client.once('connected', function () {
        console.log('Connected to ZooKeeper.');
    });
    return client;
}
function init(){
    console.info("initial!!!");
    client = createClient();
    client.on("closed",function(){
        setTimeout(init,5000);
    });
    client.connect();
}
init();

setInterval(function(){
    client && console.info(client.getState())
},3000)