If you really want actors with static typing, then you could go ahead and use typed actors in all of your code. This is very discouraging for several reasons.
1.) You run the risk of turning your system into a bunch of RPCs. The method of receiving an actor makes it obvious that the whole thing is the transmission of messages, and even more so if you simply call methods on a typed actor.
2.) The actor simply has no type. While it works, the messages that the actor can process may vary depending on the state in which it is located, how this can happen with these messages. This is a great way to model multiple protocols, and Akka actors have first-class support for it using FSM.
So, if you really want to do this, you can freely use typed actors around the world and it will work, but you should really think about the problem that you are trying to solve before you do it.
mblinn
source share