Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

streams3 #5860

@isaacs

Description

@isaacs

Crazy idea, maybe, but I think it'd be an improvement, both in functionality and understandability.

Same API as streams2, but remove the confusing modality of flowing/old mode switch.

  1. Every time read() is called, and returns some data, a data event fires.
  2. resume() will make it call read() repeatedly. Otherwise, no change.
  3. pause() will make it stop calling read() repeatedly.
  4. pipe(dest) and on('data', fn) will automatically call resume().
  5. No switches into old-mode. There's only flowing, and paused. Streams start out paused.

Thoughts? @jclulow @tjfontaine @indutny @bnoordhuis @TooTallNate @Raynos

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions