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

Piped stream should end when source ends #3

Closed
kishorenc opened this issue Oct 2, 2013 · 3 comments
Closed

Piped stream should end when source ends #3

kishorenc opened this issue Oct 2, 2013 · 3 comments

Comments

@kishorenc
Copy link
Contributor

Any reasons why the end option is set as false here (in docker run)?

stream.pipe(streamo, {end: false});

I am trying to send the stream to the browser as response, and this false option means that I have no way to find out when the stream closes so that I can send a res.end to the browser. (I tried listening for the finish event, but it does not fire).

Here's a small snippet showing what I'm trying to do:

http.createServer(function (req, res) {
   res.writeHead(200, { 'Content-Type': 'text/plain' });
   res.on('finish', function() {
     res.end('there will be no more data.');   // this never fires
   });

   docker.run('ubuntu', "echo 1", res, true, function(err, data) {      
   });
}).listen(9000);
@apocas
Copy link
Owner

apocas commented Oct 9, 2013

Humm... it is weird indeed.
Give me a "sec", to run some tests on this.

@apocas
Copy link
Owner

apocas commented Oct 11, 2013

It is indeed a typo, tests are green and everything seems fine.
Do you want to do a PR so you get the credit for the fix? :)

@apocas
Copy link
Owner

apocas commented Oct 14, 2013

Merged from your fork, thanks :)
ffbb570

@apocas apocas closed this as completed Oct 14, 2013
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