Created
August 29, 2012 21:10
-
-
Save RayRoestenburg/3519015 to your computer and use it in GitHub Desktop.
test actors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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