Skip to content

Instantly share code, notes, and snippets.

@DanielNill
Forked from fennb/gist:1124578
Created January 25, 2012 18:19
Show Gist options
  • Save DanielNill/1677714 to your computer and use it in GitHub Desktop.
Save DanielNill/1677714 to your computer and use it in GitHub Desktop.
Synchronous cache failover example
// synchronous version
myThing = synchronousCache.get("id:3244");
if (myThing == null) {
myThing = synchronousDB.query("SELECT * from something WHERE id = 3244");
}
// Do various stuff with myThing here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment