Sync call in meteor method

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?

    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;

don’t use any xyzSync method as it will block the process. Use Meteor’s built-in HTTP package which lets you write sync style code that operates async via Fibers

1 Like