You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform: Linux 4.4.0-45-generic deprecate domains #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Subsystem: Streams
#20503 fixed things with highWaterMark: 0 streams. As far as I could tell, this was merged into v10.9.0.
However the following code still fails in v10.10.0 and v11.4.0:
letutil=require('util');letReadable=require('stream').Readable;functionMyStream(){Readable.call(this,{highWaterMark: 0});}util.inherits(MyStream,Readable);MyStream.prototype._read=function(n,fn){console.log(`_read`);// Just keep emitting new data, but do that asynchronously.process.nextTick(()=>{console.log('push');this.push('a');});}lets=newMyStream();s.on('data',()=>{console.log('data');});
The MyStream implementation is supposed to continue emitting 'a' without terminating. However the output of that is:
_read
push
data
If I change the constructor into { highWaterMark: 1 } I get the expected infinite push/data cycle.
#20503 fixed things with
highWaterMark: 0streams. As far as I could tell, this was merged into v10.9.0.However the following code still fails in v10.10.0 and v11.4.0:
The
MyStreamimplementation is supposed to continue emitting 'a' without terminating. However the output of that is:If I change the constructor into
{ highWaterMark: 1 }I get the expected infinite push/data cycle.