Skip to content

doc, stream: incomplete readable._read description #45072

@Antonius-S

Description

@Antonius-S

Affected URL(s)

https://nodejs.org/dist/latest-v19.x/docs/api/stream.html#readable_readsize

Description of the problem

Now docs say

When readable._read() is called, if data is available from the resource, the implementation should begin pushing that data into the read queue using the this.push(dataChunk) method.

but they don't say what to do if data is not yet available from the resource. Also, the overall text creates an impression (at least for me) that it's enough to implement this method only for the stream to work. Only the example for readable.push sheds some light on how it is supposed to deal with resources that are being written while reading. If that's a recommended way, I think it should be mentioned as such and also underline that this way fits for Node's Readable streams as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.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