yes now I just using the context.child(name),cause I found that actorCell 
is using TreeMap,so if I want to achieve O(1),should I put an hashMap In my 
Actor implement?I found just as what you said,the RouterLogic is not the 
right approach for me.
thanks for the answer 

在 2014年5月9日星期五UTC+8上午2时59分29秒,Akka Team写道:
>
> The way you would approach this depends very much on what you want to 
> achieve: is it enough if your router can handle a million messages per 
> second? If that is the case then I would recommend just writing your own 
> actor implementing exactly what you want, not using any of the RouterLogic 
> infrastructure (since that is geared towards a more generic an reusable 
> goal). That would also mean that you do not need to worry about 
> synchronization issues at all (and as a hint: ConcurrentHashMap is not the 
> most scalable choice, especially if reads are far more frequent than 
> updates).
>
> Using a normal actor which creates children of known names sounds like a 
> good plan to me, the complexity of `context.child(name)` is O(log n) (it 
> uses a TreeMap).
>
> Regards,
>
> Roland
>
>
>
> On Wed, May 7, 2014 at 4:26 AM, 何品 <hepi...@gmail.com <javascript:>>wrote:
>
>> Hi I was trying to implement an router which could router a message to an 
>> specified routee via the message's key.just as the ConsistentHashRouter.
>> when I look at the selected method ,the comes out routees are in an 
>> immutable seq,but not a map<String,Routee>,so if I want to selected one of 
>> the routee 
>> I should iterate the routee in the seq? or I should use my one implement?
>>
>> I have checked the ConsistentHashRouter's logic,it has an inner map and 
>> an transform the data in the seq to map,and selected on the map if the 
>> passed in seq has not changed otherwise will rebuild the map.
>>
>> So ,I was wondering,If I want to implement on hash based one should I use 
>> the concorrentHashMap for the treadsafe? and how about the 
>> actorRef.getContext().child("name")?
>> should it be O(1),is it based on hash in the inner implement?
>>
>> all in all,
>> 1,if I want to implement an hash based router ,in the logic implement i 
>> must transform the seq to hashmap right?
>> 2,the child(name:String) to selecte an child of an parent Actor is O(1)?
>>
>>
>>  -- 
>> >>>>>>>>>> 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 akka-user+...@googlegroups.com <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com<javascript:>
>> .
>> 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
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