Thanks for the replies, so I suppose this typed actor will work just fine.
Any execution of the 2 methods will occur at 1 thread at each time and
state changes within the actor consists of safe publication. I run it and
it looks good.
trait MapService[K, V]
{
def update(k: K, v: V): Unit
def apply(k:K):Future[V]
}
class MapServiceImpl[K, V] extends MapService[K, V]
{
private val m = collection.mutable.Map.empty[K, V]
override def apply(k: K) = Future.successful(m(k))
override def update(k: K, v: V) = m(k) = v
}
--
>>>>>>>>>> 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.