public
Last active

watchLeaderChildren

  • Download Gist
watchLeaderChildren.scala
Scala
1 2 3 4 5 6 7 8 9 10 11 12 13 14
def watchLeaderChildren() {
curatorFramework.getChildren.usingWatcher(
new CuratorWatcher {
def process(event: WatchedEvent) {
val cs = clusterStatus()
// Do something with cluster status (log leadership change, etc)
 
// Re-set watch
curatorFramework.getChildren.usingWatcher(this).
inBackground.forPath(leaderPath)
}
}).inBackground.forPath(leaderPath)
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.