Commit ace10094 authored by Alexis Campailla's avatar Alexis Campailla
Browse files

stream: emit 'pause' on nextTick

Readable.resume() schedules the resume operation onto the next tick,
whereas pause() has immediate effect. This means that in a sequence

  stream.resume();
  stream.pause();

.. the 'pause' event will be triggered before the resume operation
is performed.

For process.stdin, we are relying on the 'pause' event to stop reading
on the underlying handle. This fix ensures that reads are started and
stopped in the same order as resume() and pause() are called.

PR-URL: https://github.com/nodejs/node/pull/5776


Reviewed-By: default avatarcjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarjasnell - James M Snell <jasnell@gmail.com>
parent 46113892
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment