What happens when I call a sync method inside a meteor method? As far as I understand nodejs is singlethreaded and other calls are blocked while getSync(url...
is executed. I saw it here.
Is is a difference if I would use Meteor.wrapAsync with the asynchronous request method?
Meteor.methods({
download: function(url) {
try {
let result = request.getSync(url, {encoding: null});
if(result.response.statusCode === 200) {
return 'data:image/png;base64,' + new Buffer(result.body).toString('base64');
}
} catch(e) {
}
return null;
}
});