Streams: Add _flush capability to writable streams#7613
Streams: Add _flush capability to writable streams#7613evansolomon wants to merge 1 commit intonodejs:masterfrom
Conversation
lib/_stream_transform.js
Outdated
There was a problem hiding this comment.
It looks like there is no need in prefinish after this change
|
@markstos is right and this doesn't work for async w._flush = function(cb){
process.nextTick(function () {
writtenData.push('flushed');
cb();
});
}I don't think it's a bug with current |
test/simple/test-stream2-writable.js
Outdated
There was a problem hiding this comment.
Also try an a async implemention of _flush and see if it still completes
before the 'finish' event is fired:
w._flush = function(cb){
process.nextTick(function () {
writtenData.push('flushed');
cb();
});
};
See related discussion here:
#7612
|
took a stab at this as well (haven't opened a pull, but can the branch is at https://github.com/calvinmetcalf/node/tree/write-flush I can open my own pull here but was waiting until it actually worked), as it is it fails 2 of the tests
|
|
@chrisdickinson @trevnorris ... this never seems to have been completed. Any thoughts on whether this is needed and whether it would need to land in v0.12? |
|
there is a more comlete pull to do this at nodejs/node#2314 |
|
Excellent. Closing this then in favor of that. Can reopen this if it becomes necessary |
Allows writable streams to define a
_flush()method that can delay thefinishevent until it completes.See #7348