I consider the use of new typed channels as a way to support the actor model in my project without the pain of a large number of explicit casts, where you really need to wait for an answer.
I was lucky with the creation of typed channels and their integration, but so far I do not see any simple solutions for creating pools of these participants for parallel execution, which is easy to do with ordinary untyped participants. Do I need to create my own router system?
For example, for untyped actors, I can do something similar, and I magically get four actors.
akkaSystem.actorOf(Props[UntypedActor]
.withRouter(RoundRobinRouter(nrOfInstances=4)), "routed")
For typed pipes, I need to do something like this:
ChannelExt(akkaSystem).actorOf(new TCActor, "singleton")
Obviously, I could write a second typed channel that creates a pool of actors and rotates between them, but this is similar to what someone would have done before!
source
share