Closed alexbeletsky closed 10 years ago
My guess is that this is a bug in mongo stream - buffering end is an edgecase that not every one implements correctly. if you listen on calc.on('end', ...)
it will buffer the end event, so one simple solution will be to just drop in a empty through stream after the mongo stream
(by default through acts as a stream that does nothing but respect back pressure)
Changed to,
calc.on('end', callback);
it gives expected output. Thanks a lot!
@alexanderbeletsky your example is a little bit confusing since you use stream twice to donate different streams. just because you pause the stream being piped to doesn't mean that the stream being piped from won't emit end
in other words - your output is not a bug in general
I've met a problem, not able to find workaround.. and even not sure is it directly related to
through
, but will appreciate assistance. I stream mongo (usingmongojs
) collection and want to process all items there, one by one, which involves some async operations.Simplified model of what I got,
The collection contains only 2 documents, so if I run the code, I can see
Something I don't expect is
end
emitted while stream supposed to remain inpaused
state.