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 [email protected].
To post to this group, send email to [email protected].
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