I have been learning about Scala recently and got stuck on the routing concept. Overall I get the idea of what a router is all about, but I don't understand the distinction between standalone routers and self contained router actors.
I've read the documentation back and forth, and this is still very confusing to me: https://doc.akka.io/docs/akka/2.5.3/scala/routing.html
Could someone please explain me (with some code or reference if possible) what is the difference between standalone routers and self contained router actors?
Thank you in advance.
EDIT:
According the documentation:
A Router can be used inside or outside of an actor, and you can manage the routees yourselves or use a self contained router actor with configuration capabilities
So I guess, it's all about how routees are managed. In one case, they are managed manually, while in the other,...well I don't see yet how they are managed with self contained router actors.
EDIT 2:
Once again, according the documentation, this is what they refer to when they talk about self-contained actors. I actually always used routers like this, but then what are standalone routers? :
val router1: ActorRef =
context.actorOf(FromConfig.props(Props[Worker]), "router1")
EDIT 3:
I guess my confusion come from the following code. This is referred to as a Standalone router:
Router(RoundRobinRoutingLogic(), routees)
What is the difference compared to this?:
val router1: ActorRef =
context.actorOf(FromConfig.props(Props[Worker]), "router1")
Is there any difference in terms of performances or capabilities?