Thanks it's works
On Wednesday, November 13, 2013 12:27:42 PM UTC+2, Akka Team wrote:
>
> Hi Richard,
>
> you'll have to lift those failures into success values, e.g. if there is a
> HttpTimeout which extends HttpResult then add
>
> .recover { case _: TimeoutException => HttpTimeout() }
>
> after the .mapTo call. Then you'll have to filter those out of the list
> you get.
>
> Regards,
>
> Roland
>
> On Monday, November 11, 2013, Richard Grossman wrote:
>
>> Hi
>>
>> I'm trying to make something like this
>>
>> implicit val timeout = Timeout(350 millis)
>> val futures = for (req <- validRequest) yield (req._1 ?
>> req._2).mapTo[HttpResult]
>> val listOfFuture = Future.sequence(futures)
>> results = Await.result(listOfFuture, timeout.duration)
>>
>> Here I've a list of request I send them to an actor that actually make
>> the query and return the result, I must wait for these results.
>>
>> The problem is for the timeout. I must have global timeout I mean that
>> all the queries must be bounded to a global timeout. but if the timeout
>> occurs I must be able to receive the response of those succeed and not get
>> Timeout exception
>>
>> If I write this
>> try {
>> implicit val timeout = Timeout(350 millis)
>> val futures = for (req <- validRequest) yield (req._1 ?
>> req._2).mapTo[HttpResult]
>> val listOfFuture = Future.sequence(futures)
>> results = Await.result(listOfFuture, timeout.duration)
>> } catch {
>> case e: TimeoutException => {
>> log.debug("Catch Here:" + results)
>> }
>> }
>>
>> I get a timeout occuring but I receive an empty list of result always.
>> Is there a way to get partial result for the queries that I get response
>>
>> Thanks
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/
>> >>>>>>>>>> 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/groups/opt_out.
>>
>
>
> --
> 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://akka.io/faq/
>>>>>>>>>> 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/groups/opt_out.