How to use the read function from readable-stream

Find comprehensive JavaScript readable-stream.read code examples handpicked from public code repositorys.

5761
5762
5763
5764
5765
5766
5767
5768
5769
//   read()s. The execution ends in this method again after the _read() ends
//   up calling push() with more data.
while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
  var len = state.length;
  debug('maybeReadMore read 0');
  stream.read(0);
  if (len === state.length) // didn't get any data, stop spinning.
    break;
}
fork icon2
star icon3
watch icon1

+ 3 other calls in file

5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
  return this;
};
function flow(stream) {
  const state = stream._readableState;
  debug('flow', state.flowing);
  while (state.flowing && stream.read() !== null);
}


// wrap an old-style stream as the async data source.
// This is *not* part of the readable stream interface.
fork icon0
star icon0
watch icon1

+ 23 other calls in file

4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
};


function flow(stream) {
  var state = stream._readableState;
  debug('flow', state.flowing);
  while (state.flowing && stream.read() !== null) {}
}


// wrap an old-style stream as the async data source.
// This is *not* part of the readable stream interface.
fork icon0
star icon0
watch icon0

+ 14 other calls in file