Skip to content

Instantly share code, notes, and snippets.

@teigen
Created February 13, 2011 12:18
Show Gist options
  • Save teigen/824645 to your computer and use it in GitHub Desktop.
Save teigen/824645 to your computer and use it in GitHub Desktop.
Akka Comet Actor Bridge. Akka actor follows comet actor lifecycle
trait AkkaCometActor extends CometActor {
implicit val optionSelf:Option[ActorRef] = Some(Actor.actorOf(new Actor{
protected def receive = {
case a => AkkaCometActor.this ! a
}
}))
override def localSetup {
super.localSetup
optionSelf.foreach(_.start)
}
override def localShutdown {
super.localShutdown
optionSelf.foreach(_.stop)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment