On Thu, Sep 24, 2015 at 9:32 PM, Sergey Sopin <[email protected]> wrote:

> In my case system doesn't stop work after timeout, so I just want to
> return the system in the initial state, so that it will be able to process
> other requests.
>

Then you need to pipe the akka.actor.Status.Failure to an actor (some
parent of the problematic actor) that understands it and throws the
exception when it receives it.


>
> Best regards,
> Sergey
>
> четверг, 24 сентября 2015 г., 21:31:37 UTC+3 пользователь Patrik Nordwall
> написал:
>
>>
>>
>> On Tue, Sep 22, 2015 at 7:07 PM, Sergey Sopin <[email protected]> wrote:
>>
>>> Hi Patrik,
>>>
>>> Thank you for clarification.
>>> I have been using onComplete() procedure in order to check response
>>> status, but now I have replaced it with the Future.map(). As result of
>>> map() operation I have a new transformed Future.
>>> In my case all child actors send to response to caller actor using
>>> following operation:
>>> Patterns.pipe(result, ec).to(sender);
>>>
>>> And each caller actor has following code:
>>>
>>> Future<object> f1 = Patterns.ask(childActorRef, new Message(Param param), 
>>> askDuration);
>>>
>>> Future<Result> result = f1.map(new Mapper<Object, Result>() {
>>>
>>>       public SignModelGenerationResponse apply(Object o) {
>>>          Result result = (Result) o;
>>>          result.add(somethig);
>>>          return result;
>>>   }
>>> }, ExecutionContext);
>>>
>>>
>>> Patterns.pipe(result, ec).to(sender);
>>>
>>>
>>> Probably you can explain me how to change this behaviour in order to
>>> avoid situations mentioned previously?
>>>
>>
>> That code looks good, but be aware of that it will send 
>> akka.actor.Status.Failure
>> message to the sender if you get a timeout.
>>
>> I don't know what you want to do. Why would you need to restart something
>> because of a ask timeout?
>>
>> /Patrik
>>
>>
>>>
>>> Best regards,
>>> Sergey
>>>
>>> вторник, 22 сентября 2015 г., 11:29:03 UTC+3 пользователь Patrik
>>> Nordwall написал:
>>>>
>>>> The supervisor strategy comes into play when a child actor throws an
>>>> exception. That is not something that happens automatically because of a
>>>> ask timeout. Normally you use ask together with pipeTo and then you will
>>>> receive a akka.actor.Status.Failure message with the exception cause. Note
>>>> that this is a message, and you have to actively throw the cause to trigger
>>>> supervision action.
>>>>
>>>> Regards,
>>>> Patrik
>>>>
>>>> On Sat, Sep 12, 2015 at 10:32 PM, Sergey Sopin <[email protected]>
>>>> wrote:
>>>>
>>>>> Workflow is following:
>>>>>
>>>>>
>>>>> <https://lh3.googleusercontent.com/-2NQ3uKBGhc4/VfSL1PLrg0I/AAAAAAAAAXk/O2bNmf2pVkk/s1600/Flow.jpg>
>>>>>
>>>>> --
>>>>> >>>>>>>>>> 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.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Patrik Nordwall
>>>> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
>>>> Twitter: @patriknw
>>>>
>>>> --
>>> >>>>>>>>>> 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.
>>>
>>
>>
>>
>> --
>>
>> Patrik Nordwall
>> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
>> Twitter: @patriknw
>>
>> --
> >>>>>>>>>> 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.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

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