I am have a bunch of long running database queries I need to get done before I render a page in node. Each of these queries require a few of their own variables. Is there an easy way to pass variables to the async.parallel() utility in nodejs?
async.parallel([
queryX(callback, A1, A2, A3),
queryX(callback, B1, B2, B3),
queryY(callback, C1, C2, C3),
queryY(callback, D1, D2, D3),
queryZ(callback, E1, E2, E3),
queryZ(callback, F1, F2, F3),
],
function(err, results) { /*Do Render Stuff with Results*/}
);
asyncdoes not have helpers for this. You could try.bind()or similar partial application methods, but your callback being in the first place is odd and might hinder using them.