Composing trait behavior in Scala in an Akka receive method
Consider these two traits: trait Poked extends Actor { override def receive = { case Poke(port, x) => ReceivePoke(port, x) } def ReceivePoke(port: String, x: Any) } trait Peeked extends Actor { override def receive = { case Peek(port) => ReceivePeek(port) } def ReceivePeek(port: String) } Now consider I can create a new Actor that implements both traits: val peekedpoked = actorRef(new Actor extends Poked with Peeked) How do I compose the receive handlers? i.e., the receiver should be something like the following code, though "automatically generated" (i.e., all traits should compose): def