Hi Soumya,
Why do you have the concurrent hash map in the Actor at all?
When using Actors you can easily have a *var* with an *immutable.Map*
which you can update/read from the Actor's receive. If you need to use
Futures,
apply the *pipeTo* pattern to forward the action to self.

Of course, if you actually have benchmarked this and observe that this is
not fast enough
(though it should be fast enough for many use-cases) you could drop down to
mutable things.

The reason I'd advertise to use vars with immutable datastructures is that
you don't
have the problem of accidentally sending a mutable thing over to someone -
in case
of the immutable Map you'd send an outdated version, but at least noone can
break it.

On Sun, Apr 26, 2015 at 2:44 AM, Soumya Simanta <[email protected]>
wrote:

> @Jeroen - Thanks. I've not looked at agents yet.
>
>
> On Saturday, April 25, 2015 at 9:45:04 AM UTC-4, Jeroen Gordijn wrote:
>>
>> Hi Soumya,
>>
>> Do agents cover your usecase?
>> http://doc.akka.io/docs/akka/snapshot/scala/agents.html
>>
>> Cheers,
>> Jeroen
>
>  --
> >>>>>>>>>> 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.
>



-- 
Cheers,
Konrad 'ktoso' Malawski
Akka <http://akka.io/> @ Typesafe <http://typesafe.com/>

-- 
>>>>>>>>>>      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