Skip to content

Instantly share code, notes, and snippets.

@blmarket
Created July 17, 2013 13:07
Show Gist options
  • Save blmarket/6020406 to your computer and use it in GitHub Desktop.
Save blmarket/6020406 to your computer and use it in GitHub Desktop.
Head First node.js zookeeper 클라이언트 샘플 코드.
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