Take a look at Endre's proposal, and if that is not what you need you could
try the AddRoutee management message:
http://doc.akka.io/docs/akka/2.3.6/java/routing.html#Managagement_Messages

/Patrik

On Tue, Sep 30, 2014 at 1:03 PM, Akka Team <[email protected]> wrote:

> Hi,
>
> Have you looked at routing groups:
> http://doc.akka.io/docs/akka/2.3.6/java/routing.html#Group
>
> They are different from Pools in that the creation of the actors
> participating in the router is handled externally and the routees are
> passed as paths.
>
> Is that suitable for your needs?
>
> -Endre
>
> On Mon, Sep 29, 2014 at 8:26 PM, akka user <[email protected]>
> wrote:
>
>> I need to know how to create a RoundRobinPool Router Actor in which each
>> one of its routees has its own reference to another object . That reference
>> that is held by every routee must be different for each routee.
>>
>> A way to do that would be something like this:
>>
>>     ActorRef ref = system.actorOf(new
>> RoundRobinPool(5).props(Props.create(Worker.class, new AnotherObject())),
>>     "router");
>>
>> but the trouble with this approach is that every worker has the same
>> reference to AnotherObject and I do not wish that side effect.
>>
>> It would be something like this, but with a Router Actor:
>>
>>
>>     List<Routee> routees = new ArrayList<Routee>();
>>         for (int i = 0; i < 5; i++) {
>>           ActorRef r = system.actorOf(Props.create(Worker.class, new
>> AnotherObject()));
>>           routees.add(new ActorRefRoutee(r));
>>         }
>>         Router router = new Router(new RoundRobinRoutingLogic(),
>> routees); // That is a Router I need an ActorRef
>>
>>
>> Has someone any idea how to do that?
>>
>>
>> Cheers
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ:
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Akka Team
> Typesafe - The software stack for applications that scale
> Blog: letitcrash.com
> Twitter: @akkateam
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to