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

Streams3 - First Pass #5865

Merged
merged 1 commit into from
Jul 22, 2013
Merged

Streams3 - First Pass #5865

merged 1 commit into from
Jul 22, 2013

Commits on Jul 22, 2013

  1. stream: Simplify flowing, passive data listening

    Closes nodejs#5860
    
    In streams2, there is an "old mode" for compatibility.  Once switched
    into this mode, there is no going back.
    
    With this change, there is a "flowing mode" and a "paused mode".  If you
    add a data listener, then this will start the flow of data.  However,
    hitting the `pause()` method will switch *back* into a non-flowing mode,
    where the `read()` method will pull data out.
    
    Every time `read()` returns a data chunk, it also emits a `data` event.
    In this way, a passive data listener can be added, and the stream passed
    off to some other reader, for use with progress bars and the like.
    
    There is no API change beyond this added flexibility.
    isaacs committed Jul 22, 2013
    Configuration menu
    Copy the full SHA
    0f8de5e View commit details
    Browse the repository at this point in the history