Skip to content

ReadStream paused and can't resume, when listened readable event #22032

Closed
@a0000778

Description

@a0000778
  • Version: 10.7.0
  • Platform: Darwin 17.7.0 / Linux 4.10.0
  • Subsystem: stream
const Readable=require('stream').Readable;

function testStream(){
	return new Readable({
		read(size){
			this.push(Buffer.alloc(size));
			this.push(null);
		}
	});
}
console.log('with readable:');
testStream()
	.on('readable',() => console.log('readable'))
	.on('data',buf => console.log(buf.length))
;

Output:

with readable:
readable

console.log('without readable:');
testStream()
	.on('data',buf => console.log(buf.length))
;

Output:

without readable:
16384

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions