0.1.3 • Published 9 years ago

optimus-image-config v0.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

#Optimus-image-config

Overview

This product is a module of zookeeper configuration loader and watcher for optimus-image.

Install

mkdir <module location>
cd <module location>
git clone <this repo>
npm install

Useage

var OptimusConfig = require('./<module location>/optimus-image-config');

var zkConnection = new OptimusConfig({
	// you can use multiple zookeeper address join with commas.
	// ex.) 000.000.000.000:2181,000.000.000.001:2181,000.000.000.002:2181
	// 2181 is default zookeeper port
	address: '<zookeeper address:port>',
	// zookeeper node like path address.
	// ex.) /optimus-image/config
	zkNode: '<zookeeper node>'
});

zkConnection.on('changed', function (data) {
	// you can use data for your application.
});

Events

optimus-image-config provides events when you watch with on method.

  • connected- Remote zookeeper is connected.
  • changed - Watched node is readed or changed.