Zk
Zk is a promised based Zookeeper client library for Node. It uses the fork of C binding from node-zookeeper and makes it easier to use.
The following methods are implemented:
get
set
create
exists
delete
getChildren
getChildren2
Install
$ npm install zk
Connection
var Zookeeper = var zk = zk
Basics
zk
return zk
Watches
Watches are implemented as promises conditionaly returned with results:
get
without watch:
zk
get
with watch:
return zk
See tests for more
Locks
var Zookeeper = var Lock = ZookeeperLockvar zk = // zk.connect() ... var lock = zk 'lockName' var promise = lock
Function passed to lock()
should return a promise. That promise will be the return value of lock()
call