GCT1015
通过I/O读取字符串到缓冲区timers阶段没有callback执行,写入WriteStream,timers阶段检测到callback,执行callback,然鹅ReadStream没数据,pipe没有效果。timers阶段检测到callback,执行callback,ReadStream数据还在,pipe有效果。用process.stdout测试const fs = require('fs')const from = fs.createReadStream('test.txt')from.pipe(process.stdout, { end: false})from.on('end', () => { console.log('end')})setTimeout(() => { console.log('timer callback') from.pipe(process.stdout) //this won't work, if time >= 3}, 3)// setTimeout(() => {// console.log('timer callback')// from.pipe(process.stdout) //this will work, if time < 3// }, 2)