Skip to content

stream, test: add tests for 'readable' state machine #8683

Description

@mcollina

Add test coverage for:

stream._readableState.needReadable
stream._readableState.emittedReadable
stream._readableState.readableListening
stream._readableState.resumeScheduled

this.needReadable = false;
this.emittedReadable = false;
this.readableListening = false;
this.resumeScheduled = false;

Those govern when and how we need to emit a 'readable' event and resume the flow.
The state machine is definitely complex, feel free to ask questions, and look hard at the source code. We can also add comments on the meaning of all those state variables.

Part of #8644.

cc @Fishrock123

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueIssues that are suitable for first-time contributors.streamIssues and PRs related to Node.js streams.testIssues and PRs related to Node.js core tests and test infrastructure.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions