Improved API of OneForOneStrategy and AllForOneStrategy. See #1714

* withinTimeRange: Duration
* Removed need for Options in API
This commit is contained in:
Patrik Nordwall 2012-01-24 08:37:01 +01:00
parent 4c6f9b86d1
commit abc072ef0a
20 changed files with 122 additions and 98 deletions

View file

@ -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 = {