I was on the wrong track debugging my particular issue - where I was seeing 
what seemed to be the wrong "Future". 

I am essentially caching completed Futures from an ask this makes my code 
simply return a cached Future if it is present or do an actual ask when it 
is not present. Caching the Future vs the result of the Future is 
convenient for me.

Thanks for your responses.

-Moiz

On Thursday, 28 May 2015 10:24:49 UTC-7, Sam Halliday wrote:
>
> A Future is definitely mutable (it will hopefully complete), but you 
> cannot mutate it.
>
> You'd be best caching the result of the Future, rather than the future 
> itself.
>
> On Wednesday, 27 May 2015 21:48:52 UTC+1, Moiz Raja wrote:
>>
>> I have a piece of code where I make a request to an actor using ask and 
>> cache the resulting future if that ask was successful. I am seeing problems 
>> in this area where when I try to access that "completed" future later on I 
>> find (a) that it does not contain a successful future and (b) the resulting 
>> timeout exception has a completely unexpected timeout.
>>
>> This makes me wonder if the ask future that is being returned is 
>> something we can cache. Is the future mutable per chance?
>>
>> Any advise on whether caching is ok or not would be helpful. 
>>
>> Thanks,
>> -Moiz
>>
>

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