Meteor._wrapAsyncIt is synchronous provided that you start the callback after all tasks are completed. It will only block the fiber if it knows that the method is complete, so when you call callback(null), it assumes that it is complete.
callback(null) connection.query, , , MySQL , ( ) , .
:
connection.beginTransaction(function(err) {
connection.query('DELETE FROM orders WHERE _id = ?', [data._id], function(err) {
connection.commit(function(err) {
callback(null);
});
});
});
Meteor.bindEnvironment, Meteor._wrapAsync, - ( , ).