add a little debugging info to batch-read

pull/1/head
ansuz 5 years ago
parent cb3df0552b
commit 29813e485d

@ -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);
});

Loading…
Cancel
Save