Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

concat stream not emitting "end" event #653

Open
benjamine opened this issue Jul 9, 2018 · 3 comments
Open

concat stream not emitting "end" event #653

benjamine opened this issue Jul 9, 2018 · 3 comments

Comments

@benjamine
Copy link

benjamine commented Jul 9, 2018

I might be missing something but I'm trying a simple stream concat of 2 streams,
and noticed that while each stream emits the "end" event, the concat result doesn't.

Reproduction Steps:

var highland = require("highland");
(function() {
s1 = highland(['1', '2', '3']), s2 = highland(['4', '5', '6']), s3 = s1.concat(s2);
const log = s => process.stdout.write(` [${s}] `);
s1.on('end', function() { log('s1 ended') });
s2.on('end', function() { log('s2 ended') });
s3.on('end', function() { log('s3 ended') });
s3.map(n => `[${n}]`).pipe(process.stdout);
})();

Outputs:
[1][2][3] [s1 ended] [4][5][6] [s2 ended] undefined
Expected:
[s3 ended] to print to console too.

ps: I noticed that if I add another transform at the end ( s4 = s3.map(....); s4.on('end', ...)), that stream does emit "end".

@vqvu
Copy link
Collaborator

vqvu commented Jul 9, 2018 via email

@benjamine
Copy link
Author

thanks!

just tried:

var highland = require("highland");
(function() {
s1 = highland(['1', '2', '3']), s2 = highland(['4', '5', '6']), s3 = s1.concat(s2);
const log = s => process.stdout.write(` [${s}] `);
s1.observe().done(function() { log('s1 done') });
s2.observe().done(function() { log('s2 done') });
s3.observe().done(function() { log('s3 done') });
s3.map(n => `[${n}]`).pipe(process.stdout);
})();

but same results

@vqvu
Copy link
Collaborator

vqvu commented Jul 9, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants