Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: flow for 'data' listeners upon removal of last 'readable' listener #21696

Closed
wants to merge 3 commits into from

Commits on Aug 9, 2018

  1. stream: flow for 'data' listeners upon 'readable' remove

    When there is at least one 'data' listener try to flow when
    last 'readable' listener gets removed and the stream is not piped.
    
    Currently if we have both 'readable' and 'data' listeners set only
    'readable' listener will get called and stream will be stalled without
    'data' and 'end' events if 'readable' listener neither read()'s nor
    resume()'s the stream.
    
    Fixes: nodejs#21398
    lundibundi committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    6fa9528 View commit details
    Browse the repository at this point in the history
  2. stream: postpone setting flowing for on('readable')

    Now state.flowing will be set only after all of the 'readable'
    listeners are gone and if we have at least one 'data' listener.
    
    * on('data') will not flow (flowing === null and not false) if there
      are 'readable' listeners
    * pipe() will work regardless of 'readable' listeners
    * isPause reports only user .pause call (before setting 'data' listener
      when there is already 'readable' listener also set flowing to false)
    * resume always sets stream to flowing state
    lundibundi committed Aug 9, 2018
    Configuration menu
    Copy the full SHA
    c07abd7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d699f48 View commit details
    Browse the repository at this point in the history