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
{{ message }}
This repository was archived by the owner on May 15, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on May 15, 2026. It is now read-only.
Callback not called / promise not resolved for non-flowing streams with data. #25
The 'data' event is emitted whenever the stream is relinquishing ownership of a chunk of data to a consumer. This may occur whenever the stream is switched in flowing mode by calling readable.pipe(), readable.resume(), or by attaching a listener callback to the 'data' event.
The 'end' event is emitted when there is no more data to be consumed from the stream. The 'end' event will not be emitted unless the data is completely consumed. This can be accomplished by switching the stream into flowing mode, or by calling stream.read() repeatedly until all data has been consumed.
I think it follows that, if there is data available on a non-flowing readable stream, then registering the data handler will cause it to start flowing and potentially result in the 'end' event firing immediately.
changed the title [-]Should register 'end' event listener before 'data' listener.[/-][+]Callback not called / promise not resolved for non-flowing streams with data.[/+]on Apr 27, 2018
@BryceCicada it seems like the module is not emitting the data chunks after the initial event loop, which is incorrect. however, this module is no longer necessary so we won't fix this. thank you for the report!
Activity
[-]Should register 'end' event listener before 'data' listener.[/-][+]Callback not called / promise not resolved for non-flowing streams with data.[/+]jonathanong commentedon Aug 31, 2024
@BryceCicada it seems like the module is not emitting the
datachunks after the initial event loop, which is incorrect. however, this module is no longer necessary so we won't fix this. thank you for the report!