Skip to content

Instantly share code, notes, and snippets.

@j14159
Last active August 29, 2015 14:04
Show Gist options
  • Save j14159/49606a5468c734fc6a28 to your computer and use it in GitHub Desktop.
Save j14159/49606a5468c734fc6a28 to your computer and use it in GitHub Desktop.
// very naive, be more specific based on your problem:
val restartStrategy = OneForOneStrategy(
maxNrOfRetries = 10,
withinTimeRange = 1 minute) {
case _ => Restart
}
def newPool(sys: ActorSystem): ActorRef = {
val props = Props(new BasicJdbcActor(connFac))
val pool = RoundRobinPool(4, supervisorStrategy = restartStrategy)
sys.actorOf(pool.props(props))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment