Skip to content

Instantly share code, notes, and snippets.

@calvinmetcalf
Last active December 10, 2015 23:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save calvinmetcalf/4507817 to your computer and use it in GitHub Desktop.
var asyncExample = function(a,b,callback){
var returnValue,returnError;//define stuff
try { //do the stuff
returnValue = doStuff(a,b);
} catch(err) { //if there is an err catch it
returnError = err;
} finally { //send it back
callback(returnError, returnValue);
}
}//program will not have to wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment