"The only thing worse than not saying anything, is telling a lie."

(i.e. I don't think that's a solution)

On Mon, Mar 21, 2016 at 7:22 PM, Endre Varga <endre.va...@lightbend.com>
wrote:

> The issue is that there might be 3rd party RS stages, or stages from a
> different materializer, so even such future will not guarantee termination
> of a graph. But maybe it is still enough.
>
> On Mon, Mar 21, 2016 at 5:56 PM, Patrik Nordwall <
> patrik.nordw...@gmail.com> wrote:
>
>> Could we have a termination Future, similar to the ActorSystem?
>>
>> mån 21 mars 2016 kl. 16:59 skrev Endre Varga <endre.va...@lightbend.com>:
>>
>>> Ah, OK that will work. The only issue is that shutdown() is asynchronous
>>> so you cannot be fully sure when it has stopped everything.
>>>
>>> -Endre
>>>
>>> On Mon, Mar 21, 2016 at 4:58 PM, <john.vie...@gmail.com> wrote:
>>>
>>>> Hi Endre,
>>>> forgive my wording. I meant calling shutdown() on the materializer of
>>>> the current exception-throwing stream  and then start this  stream
>>>> with a new materializer
>>>>
>>>> Am Montag, 21. März 2016 16:51:01 UTC+1 schrieb Akka Team:
>>>>
>>>>>
>>>>>
>>>>> On Mon, Mar 21, 2016 at 4:45 PM, <john....@gmail.com> wrote:
>>>>>
>>>>>> Hi Endre,
>>>>>> I think  I do have a valid use case. I have a stream which
>>>>>> occasionally fails seriously (maybe 2 times a year) .
>>>>>> Since it has a zip stage I have the option to either handle the
>>>>>> Exception and keep the Zip stage balanced or
>>>>>> just let the exception propagate to the default decider and just
>>>>>> restart the stream.
>>>>>>
>>>>>
>>>>> But there is no such thing as "restart the stream". The current
>>>>> built-in "supervision" only restarts a single stream processing stage but
>>>>> not the whole graph. There is currently no way to restart a whole graph 
>>>>> and
>>>>> it is not a trivial problem to tackle in general.
>>>>>
>>>>> -Endre
>>>>>
>>>>>
>>>>>> The  work of the stream is "transactional" so I have no problems with
>>>>>> the current broken state caused by the exception.
>>>>>>
>>>>>> For me restart simplifies my code so I think It is ok?!
>>>>>>
>>>>>> Am Montag, 21. März 2016 10:35:58 UTC+1 schrieb Akka Team:
>>>>>>>
>>>>>>> Hi John,
>>>>>>>
>>>>>>> I am not sure what you hope to achieve there and if that even
>>>>>>> possible. Restarting a graph is more similar to restarting a group of
>>>>>>> actors not to a single actor and it is not that easy to do given the
>>>>>>> backpressure state between the restarted stages must be preserved. Also,
>>>>>>> while one stage fails, other parts of the graph might not and still run
>>>>>>> concurrently, etc.
>>>>>>>
>>>>>>> -Endre
>>>>>>>
>>>>>>> On Fri, Mar 18, 2016 at 1:34 PM, <john....@gmail.com> wrote:
>>>>>>>
>>>>>>>> This would be the solution I would use:
>>>>>>>>
>>>>>>>> http://pastebin.com/pJVnHqcH
>>>>>>>>
>>>>>>>> I am a little unsure about mat.stop() and the Supervision.stop().
>>>>>>>>
>>>>>>>> Should the code work? I want to restart on every Exception thrown
>>>>>>>> from any Flow,Source,Sink of the Runnable graph
>>>>>>>>
>>>>>>>> Am Freitag, 18. März 2016 11:28:23 UTC+1 schrieb drewhk:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> There is no such thing at the moment.
>>>>>>>>>
>>>>>>>>> The onComplete on the sink does not guarantee that the whole
>>>>>>>>> stream has actually stopped, it only guarantees that the Sink itself 
>>>>>>>>> was
>>>>>>>>> stopped (which may or may not imply completion of the whole stream; 
>>>>>>>>> think
>>>>>>>>> of graphs).
>>>>>>>>>
>>>>>>>>> -Endre
>>>>>>>>>
>>>>>>>>> On Fri, Mar 18, 2016 at 11:25 AM, <john....@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>> If a graph throws an Exception in any flow  I want  to restart
>>>>>>>>>> the graph.
>>>>>>>>>>
>>>>>>>>>> Actually I would love to have something like Akka Actors
>>>>>>>>>> OneForOneStrategy(10, Duration.create("1 minute")),,,,
>>>>>>>>>>
>>>>>>>>>> I couldn't find the right hints in the docs. What I am trying
>>>>>>>>>> right now is this pseudo code:
>>>>>>>>>>
>>>>>>>>>> Function<Throwable, Supervision.Directive> decider = exc -> 
>>>>>>>>>> Supervision.stop();
>>>>>>>>>> Sink sink = ....;
>>>>>>>>>>
>>>>>>>>>> RunnableGraph<Future<Integer>> runnableGraph = takeGraph.toMat(sink, 
>>>>>>>>>> Keep.right());
>>>>>>>>>>
>>>>>>>>>> ActorMaterializer mat = 
>>>>>>>>>> ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
>>>>>>>>>>  system);
>>>>>>>>>>
>>>>>>>>>> runnableGraph.run(mat).onComplete(new OnComplete<Integer>() {
>>>>>>>>>>    public void onComplete(Throwable failure, Integer value) {
>>>>>>>>>>       ActorMaterializer mat2 = 
>>>>>>>>>> ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider),
>>>>>>>>>>  system);
>>>>>>>>>>       runnableGraph.run(mat2);
>>>>>>>>>>    }
>>>>>>>>>> }, system.dispatcher());
>>>>>>>>>>
>>>>>>>>>> Obviously the above code would only restart once...
>>>>>>>>>> Anyway is this the right direction?
>>>>>>>>>> Is there an idiomatic way to setup restart of an Runablegraph when a 
>>>>>>>>>> Exception happens
>>>>>>>>>>
>>>>>>>>>> Write now I am thinking of creating a Supervision Actor and use it 
>>>>>>>>>> to init and restart the Runablegraph
>>>>>>>>>>
>>>>>>>>>> Many Greetings
>>>>>>>>>> John
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> >>>>>>>>>> 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 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.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>> >>>>>>>>>> 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 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.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Akka Team
>>>>>>> Typesafe - Reactive apps on the JVM
>>>>>>> Blog: letitcrash.com
>>>>>>> Twitter: @akkateam
>>>>>>>
>>>>>> --
>>>>>> >>>>>>>>>> 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 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.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Akka Team
>>>>> Typesafe - Reactive apps on the JVM
>>>>> Blog: letitcrash.com
>>>>> Twitter: @akkateam
>>>>>
>>>> --
>>>> >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/akka-user.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>>> >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
>>> To post to this group, send email to akka-user@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Cheers,
√

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to