aboutsummaryrefslogtreecommitdiff
path: root/lib/pull-many-v2.js
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-11-11 13:03:58 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-11-11 13:03:58 -0500
commit6be6dd5b44d890f381c18227db0d061e48245710 (patch)
tree5350070d13a156ee94a2756cb61b3b44492d7d55 /lib/pull-many-v2.js
parentca3b8e0465605759d512b0852813e599b94874e4 (diff)
downloadpatchfoo-6be6dd5b44d890f381c18227db0d061e48245710.tar.gz
patchfoo-6be6dd5b44d890f381c18227db0d061e48245710.zip
Tyler's changes
Diffstat (limited to 'lib/pull-many-v2.js')
-rw-r--r--lib/pull-many-v2.js13
1 files changed, 11 insertions, 2 deletions
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
}