Improved API of OneForOneStrategy and AllForOneStrategy. See #1714
* withinTimeRange: Duration * Removed need for Options in API
This commit is contained in:
parent
4c6f9b86d1
commit
abc072ef0a
20 changed files with 122 additions and 98 deletions
|
|
@ -20,13 +20,14 @@ object FaultHandlingDocSpec {
|
|||
//#strategy
|
||||
import akka.actor.OneForOneStrategy
|
||||
import akka.actor.SupervisorStrategy._
|
||||
import akka.util.duration._
|
||||
|
||||
override val supervisorStrategy = OneForOneStrategy({
|
||||
case _: ArithmeticException ⇒ Resume
|
||||
case _: NullPointerException ⇒ Restart
|
||||
case _: IllegalArgumentException ⇒ Stop
|
||||
case _: Exception ⇒ Escalate
|
||||
}: Decider, maxNrOfRetries = Some(10), withinTimeRange = Some(60000))
|
||||
}: Decider, maxNrOfRetries = 10, withinTimeRange = 1 minute)
|
||||
//#strategy
|
||||
|
||||
def receive = {
|
||||
|
|
@ -40,13 +41,14 @@ object FaultHandlingDocSpec {
|
|||
//#strategy2
|
||||
import akka.actor.OneForOneStrategy
|
||||
import akka.actor.SupervisorStrategy._
|
||||
import akka.util.duration._
|
||||
|
||||
override val supervisorStrategy = OneForOneStrategy({
|
||||
case _: ArithmeticException ⇒ Resume
|
||||
case _: NullPointerException ⇒ Restart
|
||||
case _: IllegalArgumentException ⇒ Stop
|
||||
case _: Exception ⇒ Escalate
|
||||
}: Decider, maxNrOfRetries = Some(10), withinTimeRange = Some(60000))
|
||||
}: Decider, maxNrOfRetries = 10, withinTimeRange = 1 minute)
|
||||
//#strategy2
|
||||
|
||||
def receive = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue