既にMeteor.binEnvironment内にある関数内で を実行する<collection>.find ({})
と、次のエラー メッセージが表示されます。throw new Error ('Can \' t wait without a fiber ');
Meteor.bindEnvironment(<collection>.find ({}))
throw new Error (noFiberMessage);
問題の関数は、Meteor.methods ({})
どこが間違っているのでしょうか?
エラーを再現する例:
Meteor.methods({
"teste" : Meteor.bindEnvironment(function(){
var Future = Meteor.require('fibers/future');
var future = new Future();
setTimeout(function(){
return future.return(Sessions.findOne({}))
}, 15000);
console.log('fut', future.wait());
})
});