ASHWIN YADAV ASHWIN YADAV - 22 days ago 12
Java Question

Java Akka - Broadcasting Message to Child Actors from Parent Context

ActorSelection selection = context.actorSelection( "/user/ParentActor/*");
selection.tell(msg,null);


Assumming the parent actor context presented here in the example has more than 1 actor.

Does the above tell statement send message to all child actors sequentially or parallely.That is whether the tell statement behave like a broadcastor or internally an iteration is performed to send message to each actor in the selection

Answer

Looking here (which is the method called by the tell) it seems to use an iterator, so I'd say sequential.

Nonetheless, it's a quite lightweight operation, so you shouldn't worry too much about it.

Comments