Skip to content

Instantly share code, notes, and snippets.

View jasongoodwin's full-sized avatar

Jason Goodwin jasongoodwin

View GitHub Profile
@jasongoodwin
jasongoodwin / gist:7156238
Last active December 26, 2015 13:09
Demonstrates changing the default Stop supervision behaviour on a top level actor encountering an exception/error during initialization (above /user guardian actor). Demonstrates how exceptions are thrown out of akka extensions as well (they throw like any other class).
import akka.actor._
import akka.actor.SupervisorStrategy._
import akka.routing.RoundRobinRouter
object Main {
val system = ActorSystem("TestActorSystem")
val escalator = OneForOneStrategy() {
case e: ActorInitializationException ⇒
println("Got exception during actor start: " + e)