Skip to content

Instantly share code, notes, and snippets.

@RayRoestenburg
Created August 29, 2012 21:10
Show Gist options
  • Save RayRoestenburg/3519015 to your computer and use it in GitHub Desktop.
Save RayRoestenburg/3519015 to your computer and use it in GitHub Desktop.
test actors
case class SomeMessage(id:Long, text:String) extends HasId
class Transformer(next: ActorRef) extends Actor with Node{
def receive = {
case m:SomeMessage =>
send (next, m.copy(text = (m.text.head.toUpper +: m.text.tail).toString))
}
}
class Printer extends Actor {
def receive = {
case m:SomeMessage =>
println(m.text)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment