private def actor(state: Option[R], calc: () => Future[R]): Actor.Immutable[Message] = Actor.immutable[Message] {
(_, msg) =>
msg match {
case Get(replyTo) =>
state match {
case Some(f) =>
replyTo ! f
Actor.same
case None =>
val f = calc().awaitFor(maxWaitForFuture)
replyTo ! f
actor(Some(f), calc)
}
case Flush =>
actor(None, calc)
}
}
--
>>>>>>>>>> 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 a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/sV4lS4AS4sg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.