Skip to content

Instantly share code, notes, and snippets.

@ericacm
Created October 24, 2012 00:56
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/3943058 to your computer and use it in GitHub Desktop.
Save ericacm/3943058 to your computer and use it in GitHub Desktop.
refreshWorkers
def refreshWorkers() {
val cs = clusterService.clusterStatus
for (participant <- cs.participants) {
val path = if (cs.current == participant)
akkaConfig.localActorPath(workerPath)
else
remotePathForParticipant(
akkaConfig, participant, workerPath)
val remoteRef = context.actorFor(path)
if (workers.get(remoteRef).isEmpty)
workers += remoteRef->None
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment