You're explicitly asking it not to emit an end event by passing end: false to pipe.
On 14 Απρ 2013, at 12:01 π.μ., Ruud <r.bij...@gmail.com> wrote: > Hey, > > I'm trying to create a streaming parser/transformer for a special web proxy > project. The 'streams2' stream.Transform base class makes this quite easy, > but trying to benchmark some thing I've hit a problem: it seems no (end) > events are emitted. > > The docs don't list any events under this class explicitly, but one would > imagine the events from the stream.Readable and stream.Writable are also > implemented in stream.Transform. > > My question: Am I doing something wrong, is this by design, or could this be > considered a bug? > > Al I could find on the subject is this Stack Overflow question + comment > > Code (more or less): >> stream = require('stream'); >> function Parser (options) { >> if (!(this instanceof Parser)) return new Parser(options); >> stream.Transform.call(this, options); >> this.options = options || {}; >> } >> util.inherits(Parser, stream.Transform); >> Parser.prototype._transform = function(chunk, encoding, done) { >> // magic stuff that transforms chunk >> this.push(chunk); >> done(); >> }; >> >> parser = new Parser(); >> parser.on('end', function () { >> console.log('This will never happen ???'); >> }); >> req.pipe(parser, {end: false}).pipe(res); > > > > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to nodejs+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.