These are chat archives for petabridge/akka-bootcamp

Jul 2016
Alessandro Rizzotto
Jul 29 2016 08:02
Is it possible to add/remove new actor from a ConsistentHashingPool once it has been created? The idea would be to add/remove UserActor as they go online/offline. I may as well create a "normal" actor that coordinate the process adding/removing UserActor from a Dictionay but I'm afraid that with to many UserActors this would be a bottleneck (each user actor would run "in parallel" but the process of dispatching job from the ONLY CoordinatorActor to User actors would be the bottleneck).
Alessandro Rizzotto
Jul 29 2016 14:30
I think reading on I start understanding better the use cases of router. So in my case the problem is that, having an ASP.NET application, on the controller action I start using ONE actor in order to distribute work to be done. I have 2 options:
1) I use a "coordinator" actor with a IActorRef: the problem here is the the work distribution is a bottleneck because every time the ASP.NET action in controller is hit, it need to refer to the actor "coordinator" (in this case there is only one "coordinator") to offload some job on other actors
2) I send the job message directly to the working actor using a ActorSelection (every actor has a well defined name): the problem here is that is difficult to check if the actor already exist o if I need to create a new one (with ActorSelection I don't get a IActorRef so I need some hack to get it - RealizeOne I think is called the method but it look like is a too long process and is blocking the subsequent call to the controller)
So I guess the solution here may be using solution (1) where the "coortinator" actor is a router that send message to many "sub coordinator" actors (RoundRobin). Each "sub coordinator" actor may then use ActorSelection because it has more time to lookup the right worker actor. Don't know if this is the right choice... Any help would be appreciated.
PS: some context on the application: each worker actor correspond to a specific User so I need to offload the job to the correct User. This is why I need to get a IActorRef to that specific User