Is there happens before relation between different meteor method calls


#1

Hi All,

I have the following problem:

I am building a simple e-Commerce application and I would like to update my inventory on checkout.

However, multiple users can checkout at the same time. Currently, my code has a structure like:

function checkout(){
Meteor.call(‘makeTransaction’, function(e,s) {
… processing…
});
};

Now makeTransaction should check the inventory and charge the user if there are available items. Now what I am wondering is, can I safely assume (this is of course if I am running a single server) that all calls will be executed synchronously. I read that Node.js is single threaded, but does it mean that all calls are executed synchronously? Or is there some additional scheduling taking place?

Thanks,
Vasil