- Version: >= 10.0.0
- Platform: any
- Subsystem: stream
Consider the following example, born from discussion in #25969.
const { Readable } = require('stream');
const buf = Buffer.alloc(8192);
const readable = new Readable({
read() {
this.push(buf);
}
});
readable.on('readable', function() {
const data = readable.read();
console.log(data.length);
});
Note that readable.read() is not called in a loop on purpose.
Expected behavior
An endless loop. This works as expected in Node.js < 10.0.0.
Actual behavior
Reading stops after a few reads.
Bisecting points to this commit: 0778f79.
Consider the following example, born from discussion in #25969.
Note that
readable.read()is not called in a loop on purpose.Expected behavior
An endless loop. This works as expected in Node.js < 10.0.0.
Actual behavior
Reading stops after a few reads.
Bisecting points to this commit: 0778f79.