Skip to content

Instantly share code, notes, and snippets.

@fmpwizard
Created February 18, 2011 16:57
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 fmpwizard/833981 to your computer and use it in GitHub Desktop.
Save fmpwizard/833981 to your computer and use it in GitHub Desktop.
MyListeners object
object MyListeners extends Logger{
private var listeners: Map[String, LiftActor] = Map()
def listenerFor(str: String): LiftActor = synchronized {
listeners.get(str) match {
case Some(a) => info("Our map is %s".format(listeners)); a
case None => {
val ret = new DispatcherActor(str)
listeners += str -> ret
info("Our map is %s".format(listeners))
ret
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment