From 6be6dd5b44d890f381c18227db0d061e48245710 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Thu, 11 Nov 2021 13:03:58 -0500 Subject: Tyler's changes --- lib/pull-many-v2.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/pull-many-v2.js') diff --git a/lib/pull-many-v2.js b/lib/pull-many-v2.js index beea621..feb68ce 100644 --- a/lib/pull-many-v2.js +++ b/lib/pull-many-v2.js @@ -1,5 +1,6 @@ // All credit to https://github.com/pull-stream/pull-many/blob/master/index.js -// Edits have been made to distinguish the original stream that each object came from +// Edits have been made to distinguish the original stream that each object came from, +// and to be able to end each stream independently module.exports = function (ary) { @@ -59,7 +60,13 @@ module.exports = function (ary) { current.ready = true current.reading = false - if(end === true || abort) current.ended = true + if(end === true || abort) { + current.ended = true + if(current.read.streamName) { + var timestamp = new Date(); + console.log("[pull-many-v2] [" + timestamp.toISOString() + "] " + "reached the end of stream " + current.read.streamName); + } + } else if(end) abort = current.ended = end //check whether we need to abort this stream. if(abort && !end) current.read(abort, next) @@ -90,6 +97,8 @@ module.exports = function (ary) { read.cap = function (err) { read.add(null) } + + read.inputs = inputs return read } -- cgit v1.2.3