How to restrict actor messages to specific types?
问题 In Akka, is there a way to restrict messages to actors to be of a specific static type other than using the "Typed Actor" APIs that use an RPC style programming model? Can I use the message passing style with Akka without throwing away static type safety at the actor boundaries? For example, I'd like to use code like this: sealed abstract class FooMessage case object Foo extends FooMessage case object Bar extends FooMessage class FooActor extends Actor[FooMessage] { def receive = { case Foo =