Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

watchLeaderChildren

View watchLeaderChildren.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)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.