Skip to content

Instantly share code, notes, and snippets.

@erikvanoosten
Last active October 10, 2015 00:38
Show Gist options
  • Save erikvanoosten/3604873 to your computer and use it in GitHub Desktop.
Save erikvanoosten/3604873 to your computer and use it in GitHub Desktop.
Sentries example usage
class DoItAllService extends nl.grons.sentries.support.SentrySupport {
val dbSentry = sentry("mysql:localhost:3366") withMetrics withFailLimit(failLimit = 5, retryDelay = 500 millis)
val twitterApiSentry = sentry("twitter") withMetrics withFailLimit(failLimit = 5, retryDelay = 500 millis) withConcurrencyLimit(3)
def loadTweetFromDb(id: Long): Tweet = dbSentry {
database.load(id)
}
def getFromTwitter(id: Long): Tweet = twitterApiSentry {
twitterApi.load(id)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment