Last active
October 10, 2015 00:38
-
-
Save erikvanoosten/3604873 to your computer and use it in GitHub Desktop.
Sentries example usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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