Any drawback to using Meteor.wrapAsync in server methods?

I’m looking at specifically using Meteor.wrapAsync on Node.js net and ecwyne:xmlrpc in Meteor methods. There could potentially be a couple seconds delay before these methods return to the client. Is that a problem at all on the server side, or does Meteor.wrapAsync handle all that for me? In other words, what if 200 concurrently calling these methods? I just want to be sure no one is blocking each other, and that the server is not getting stuck on something.

Generally speaking methods are blocking per client unless you call this.unblock() in the method. However, methods do not block between clients. Having said that, there is (commonly) only one server process, so if you introduce a heavy computation, for example, that will affect all clients.

Long story short: if you are using wrapAsync just to allow an asynchronous operation to run in a synchronous style and there is no CPU intensive heavy lifting, you should be fine.


1 Like

Thanks Rob! I figured it would be ok since this is exactly what it’s supposed to be used for.

1 Like