Skip to content

Instantly share code, notes, and snippets.

@adamw
Created June 10, 2018 13:56
Show Gist options
  • Save adamw/11b58818922e12a28fa2cfb4fb7bc955 to your computer and use it in GitHub Desktop.
Save adamw/11b58818922e12a28fa2cfb4fb7bc955 to your computer and use it in GitHub Desktop.
class BroadcastActor(connector: QueueConnector[Future])
extends Actor with ActorLogging {
// ...
// optional - the default one is identical
override def supervisorStrategy: SupervisorStrategy = OneForOneStrategy() {
case _: ActorInitializationException => Stop
case _: ActorKilledException => Stop
case _: DeathPactException => Stop
case e: Exception =>
log.info(s"[broadcast] exception in child actor: ${e.getMessage}, restarting")
Restart
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment