diff --git a/lib/batch-read.js b/lib/batch-read.js index 66f106c54..3e729e66d 100644 --- a/lib/batch-read.js +++ b/lib/batch-read.js @@ -39,7 +39,7 @@ read('./pewpew.txt', function (err, data) { */ -module.exports = function () { +module.exports = function (/* task */) { var map = {}; return function (id, cb, impl) { if (typeof(cb) !== 'function' || typeof(impl) !== 'function') { @@ -49,6 +49,9 @@ module.exports = function () { map[id] = [cb]; impl(function () { var args = Array.prototype.slice.call(arguments); + + //if (map[id] && map[id].length > 1) { console.log("BATCH-READ DID ITS JOB for [%s][%s]", task, id); } + map[id].forEach(function (h) { h.apply(null, args); });