Created
July 17, 2013 13:07
-
-
Save blmarket/6020406 to your computer and use it in GitHub Desktop.
Head First node.js zookeeper 클라이언트 샘플 코드.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zookeeper = require 'node-zookeeper-client' | |
client = zookeeper.createClient '__your__zookeeper__host__with:port__' | |
listChildren = (client, path) -> | |
client.getChildren( | |
path | |
(err, children, stat) -> | |
console.log err, children | |
) | |
# client.create '/apiserver', new Buffer("1324"), (err, path) -> | |
# console.log err, path | |
client.getData '/apiserver', (err, res) -> | |
console.log err, res, res.toString() | |
client.once 'connected', -> | |
console.log 'Connected' | |
listChildren client, '/' | |
# client.close() | |
client.connect() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment