Skip to content

Instantly share code, notes, and snippets.

@remeniuk
Created November 23, 2010 20:54
Show Gist options
  • Save remeniuk/712507 to your computer and use it in GitHub Desktop.
Save remeniuk/712507 to your computer and use it in GitHub Desktop.
case RegisterActor(actor) =>
log.debug("Registering remote actor [%s]" format(actor))
if(!isActorInRegistry(actor.uuid) && !isLinkToLocal(actor))
ActorRegistry.register( // Hack for 0.10, 1.0-M1
RemoteClient.actorFor(actor.uuid.toString, actor.className, actor.hostname, actor.port)
) // RemoteActorRefs will register themselves in 1.0-M1+
case UnregisterActor(actor) => {
log.debug("Unregistering remote actor [%s]" format(actor))
ActorRegistry.foreach{act =>
if(act.uuid == actor.uuid){
ActorRegistry.unregister(act)
}}
Option(linkedRegistries.get(RegistryLink(actor.hostname, actor.port))) match{
case Some(_) => removeLinkToRegistry(RegistryLink(actor.hostname, actor.port))
case None => log.debug("[%s] is not a registry link" format(actor.uuid))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment