May 2017
Intermediate to advanced
414 pages
13h
English
import akka.actor.SupervisorStrategy.{Escalate, Stop, Resume, Restart} import akka.actor._ import scala.concurrent.duration._
case class Add(a: Int, b: Int) case class Sub(a: Int, b: Int) case class Div(a: Int, b: Int)
class Calculator(printer: ActorRef) extends Actor { override def preRestart(reason: Throwable, message: Option[Any]): Unit = { println("Calculator : I am restarting because of ArithmeticException") } def receive = { case Add(a, b) => printer ! s"sum is ${a + b}" case Sub(a, b) => ...Read now
Unlock full access