Skip to content

Instantly share code, notes, and snippets.

@nanusdad
Last active November 30, 2015 07:12
Show Gist options
  • Save nanusdad/b6e24a48ab406e8723dc to your computer and use it in GitHub Desktop.
Save nanusdad/b6e24a48ab406e8723dc to your computer and use it in GitHub Desktop.
Using Future with Meteor
function callToEngine(argument) {
var Future = Npm.require('fibers/future');
var fut = new Future();
///do stuff
engine.on('close', function(code)
{
result = JSON.parse(answerBuffer);
console.log('child process exited with code ' + code);
fut.return(result);
});
return fut.wait();
}
// From http://stackoverflow.com/questions/16777917/meteor-execute-system-command-synchronously
// Additional reading : https://gist.github.com/possibilities/3443021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment