Skip to content

Instantly share code, notes, and snippets.

@geNAZt
Created May 1, 2013 11:12
Show Gist options
  • Save geNAZt/5494774 to your computer and use it in GitHub Desktop.
Save geNAZt/5494774 to your computer and use it in GitHub Desktop.
var sync = require('synchronize');
function executeQuery(qryString, cb) {
setTimeout(function() {
cb(null, qryString);
}, 1500);
}
sync.fiber(function() {
var query = function(qryString) {
return sync.await(executeQuery(qryString, sync.defer()));
}
var result = query("SELECT * FROM *");
console.log(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment