From 3ef035f8099734bb1198a9db130321f5b17f1463 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Thu, 13 Apr 2017 15:48:23 +0200 Subject: [PATCH] Document using OneForOne with BackoffSupervisor I remember finding this API oddly specific at first, and it came up again in --- akka-actor/src/main/scala/akka/pattern/BackoffOptions.scala | 3 ++- akka-actor/src/main/scala/akka/pattern/BackoffSupervisor.scala | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/akka-actor/src/main/scala/akka/pattern/BackoffOptions.scala b/akka-actor/src/main/scala/akka/pattern/BackoffOptions.scala index e933e4d3cc..b5e660d9de 100644 --- a/akka-actor/src/main/scala/akka/pattern/BackoffOptions.scala +++ b/akka-actor/src/main/scala/akka/pattern/BackoffOptions.scala @@ -166,7 +166,8 @@ trait BackoffOptions { * Returns a new BackoffOptions with the supervisorStrategy. * @param supervisorStrategy the supervisorStrategy that the back-off supervisor will use. * The default supervisor strategy is used as fallback if the specified supervisorStrategy (its decider) - * does not explicitly handle an exception. + * does not explicitly handle an exception. As the BackoffSupervisor creates a separate actor to handle the + * backoff process, only a [[OneForOneStrategy]] makes sense here. */ def withSupervisorStrategy(supervisorStrategy: OneForOneStrategy): BackoffOptions diff --git a/akka-actor/src/main/scala/akka/pattern/BackoffSupervisor.scala b/akka-actor/src/main/scala/akka/pattern/BackoffSupervisor.scala index 43728bad29..f6a5f973fb 100644 --- a/akka-actor/src/main/scala/akka/pattern/BackoffSupervisor.scala +++ b/akka-actor/src/main/scala/akka/pattern/BackoffSupervisor.scala @@ -65,7 +65,8 @@ object BackoffSupervisor { * random delay based on this factor is added, e.g. `0.2` adds up to `20%` delay. * In order to skip this additional delay pass in `0`. * @param strategy the supervision strategy to use for handling exceptions - * in the child + * in the child. As the BackoffSupervisor creates a separate actor to handle the + * backoff process, only a [[OneForOneStrategy]] makes sense here. */ def propsWithSupervisorStrategy( childProps: Props,