Last active
November 30, 2015 07:12
-
-
Save nanusdad/b6e24a48ab406e8723dc to your computer and use it in GitHub Desktop.
Using Future with Meteor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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