Skip to content

Instantly share code, notes, and snippets.

@fennb
Created August 4, 2011 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fennb/1124578 to your computer and use it in GitHub Desktop.
Save fennb/1124578 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