This bothered me for a while, so I thought I would just do a quick QA:
If you have a regular nodeJS module or something else, and it has an asynchronous function on the server side. How to make it synchronous. For example, how to convert the asynchronous function nodejs fs.stat to synchronous.
for example, I have
server side js
Meteor.methods({ getStat:function() { fs.stat('/tmp/hello', function (err, result) { if (err) throw err; console.log(result) }); } });
If I call this from the client, I return undefined as the result, because the result is in the callback.
asynchronous meteor node-fibers sync
Akshat
source share