Let's say I have an actor in a region, and each region has a certain number of people inside it. As you pass on the message to everyone, knowing that the list of people may change over time, broadcast routers seem to be the choice, but then the problem is that they have the maximum number of routes, and that I cannot dynamically add people to the router.
My question is: I know that there is an EventBus, I could subscribe my people to the Bus Bus of events, but I do not want them to receive every sent message, I want them to receive messages from the region.
right now in akka, we need to create a router with a certain number of routes, Example:
Router router = new router(person1, person2)
itβs bad, because in the beginning there is nobody in this region, I donβt know the people who will join my region.
Is there a way to make a kind of dynamic router: Example:
Region region = new region() region.router = new Router() Person person1 = new Person() region.router.subscribe(person1); region.router.tell("hello",null);
java akka broadcast router
popo joe
source share