This worked great in Meteor 1.2
Is this still the way to go for async calls?
Meteor.methods({
myMeteorMethod: function() {
// load Future
Future = Npm.require('fibers/future');
var myFuture = new Future();
// call the function and store its result
SomeAsynchronousFunction("foo", function (error,results){
if(error){
myFuture.throw(error);
}else{
myFuture.return(results);
}
});
return myFuture.wait();
}
});