Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
Closed
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
In the following testcase the _flush callback is not being called after stream.end().
Simply removing the stream.write(null); line works fine.
Is it possible to end a stream with stream.write(null) and stream.end() or only the latter.
If so, why does stream.write(null) prevent stream.end() from triggering _flush?
varTransform=require('readable-stream/transform'),inherits=require('util').inherits;functionMyTransform(opts){Transform.call(this,opts);}inherits(MyTransform,Transform);MyTransform.prototype._transform=function(chunk,enc,next){console.log('.');next();};MyTransform.prototype._flush=function(){console.log('END');};// ---varstream=newMyTransform({objectMode: true});stream.write({a: 'b'});stream.write(null);stream.end();same behaviour on v0.11.14 and v0.10.33
ref: #89
Metadata
Metadata
Assignees
Labels
streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.