Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

node-zookeeper-thrift

0.0.2 • Public • Published

node-zookeeper-thrift

Provide functionality that can traverse the ZooKeeper hierarchy and read/deserialize thrift-encoded nodes for Node.JS

Usage

var zkt = require('node-zookeeper-thrift');

var server = "yourZookeeperServer.com:2181";

// see zookeeper-thrift/lib/thrift.js for instructions on how to generate thriftClient for your schema
var thriftClient = require('./config/thrift/gen-nodejs/GENERATED_OUTPUT').YOUR_CLASS_NAME;

// associate paths in zookeeper schema to (optional) thrift clients for deserialization
var schema = {
  "/path/to/service/one": {thriftClient: thriftClient},
  "/path/to/service/two": {thriftClient: thriftClient}
}

// fetch (read and deserialize) all the child nodes of provided schema paths
zkt.fetch(server, schema, function(err, results) {
  if (err) {
    console.log("ERROR: ", err);
  } else {
    console.log("RESULT: ", results);
  }
})

Keywords

none

install

npm i node-zookeeper-thrift

Downloadsweekly downloads

5

version

0.0.2

license

none

repository

githubgithub

last publish

collaborators

  • avatar