Class DeciderBuilder

java.lang.Object
org.apache.pekko.japi.pf.DeciderBuilder

public class DeciderBuilder extends Object
Used for building a partial function for Actor.supervisorStrategy(). * Inside an actor you can use it like this with Java 8 to define your supervisorStrategy.

Example:

 @Override
 private static SupervisorStrategy strategy =
   new OneForOneStrategy(10, Duration.ofMinutes(1), DeciderBuilder.
     match(ArithmeticException.class, e -> resume()).
     match(NullPointerException.class, e -> restart()).
     match(IllegalArgumentException.class, e -> stop()).
     matchAny(o -> escalate()).build());

 @Override
 public SupervisorStrategy supervisorStrategy() {
   return strategy;
 }