async.eachLimit(rowset.rows, 200, storeRow, postProcessingFunction);
function storeRow(row, cb) {...}
如何将其他参数传递给
storeRow()
?所以像这样:
async.eachLimit(rowset.rows, 200, storeRow, rowset.param, postProcessingFunction);
function storeRow(row, param, cb) {...}
最佳答案
您可能不需要那样做。相反,您可以执行以下操作:
function foo(param) {
async.eachLimit(rowset, 200, storeRow, postProcessingFunction);
function storeRow(row, cb) { /* this code uses param */ }
}