Skip to content

doc: readable events and their emissions #32709

@mikolaj-leszczynski

Description

@mikolaj-leszczynski

Hi guys,

AFAIK, readable events are emitted in three cases:

  • on the very beginning of the stream reading
  • at the end of the stream reading - just before the end event
  • on every call to .read function if only stream.length < stream.highWaterMark (
    state.length <= state.highWaterMark;
    )

However the doc says something different:

These two senteces from the doc are quite opposite. First sentence is not truth - we get readable events also in other cases. Second sentence is also not truth - the readable event is not emitted every time there is something in the stream to be read. When stream.length >= stream.highWaterMark then the readable event is not emitted even though there is data available to be read from the stream.

Generally speaking the documentation about readable events, their emissions and edge cases is really poor. Is it me who does not get it or is it indeed misleading?

Metadata

Metadata

Assignees

No one assigned

    Labels

    streamIssues and PRs related to the stream subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions