Skip to content

Instantly share code, notes, and snippets.

@ericacm
Created October 23, 2012 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericacm/3935937 to your computer and use it in GitHub Desktop.
Save ericacm/3935937 to your computer and use it in GitHub Desktop.
leaderSelector app startup
startThread("leaderSelection") {
while (electingLeader) {
selectLeader()
electLoop.acquire()
if (electingLeader) log.info("Lost connection to Zookeeper - reselecting leader")
}
}
log.info("Waiting for leader to be selected")
leaderSelected.acquire()
log.info("Leader selected")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment