-
Notifications
You must be signed in to change notification settings - Fork 300
Closed
Description
(Context: Automattic/node-canvas#740 (comment))
Any chance anyone remembers behaviors/bugs in 0.10.x that cause stream.Readable to start emitting data as soon as .on("data", fn) is attached but before .on("end", fn)?
var stream = xx.createStream();
stream.on("data", function () { console.log("data emitted"); });
stream.on("end", function () { console.log("end emitted"); }); // won't be called unless moved before .on("data")This behavior seems unique to 0.10 (not 0.12 or later) and unique to stream.Readable (not stream.Stream). I'm not sure if my usage of stream.Readable is causing this (e.g. https://github.com/Automattic/node-canvas/pull/740/files#diff-45eee70dc7ffb2bde8f118a35949d995). I think it can be fixed by wrapping the emitter in process.nextTick, but I would like to make sure that's not a fix for something I'm doing wrong. Thanks!
Metadata
Metadata
Assignees
Labels
No labels