src/io/log-stream.js
// false, no more values are emitted until the flow is resumed.
false, no more values are emitted until the flow is resumed.
false no more values are emitted until the flow is resumed .
pushValues() {
    while (!this.isPaused && this.readFrom >= 0) {
      const newLine = this.buffer.lastIndexOf(LINE_BREAK, this.readFrom);
      let limit = -1;
      let line = null;
      if (newLine !== 0) {
        limit = this.buffer.lastIndexOf(LINE_BREAK, newLine - 1);
        line = this.buffer.slice(limit + 1, newLine + 1);
      } else {
        line = this.buffer.slice(0, 1);
      }
      this.readFrom = limit;
      if (limit < 0) {
        this.lastHead = Buffer.from(line);
        if (this.bRead === this.size) {
          this.isPaused = !this.push(this.lastHead);
        }
      } else {
        this.isPaused = !this.push(line);
      }
    }
  }
pushValues ( ) { while ( ! this . isPaused && this . readFrom >= 0 ) { const newLine = this . buffer . lastIndexOf ( LINE_BREAK , this . readFrom ) ; let limit = - 1 ; let line = null ; if ( newLine !== 0 ) { limit = this . buffer . lastIndexOf ( LINE_BREAK , newLine - 1 ) ; line = this . buffer . slice ( limit + 1 , newLine + 1 ) ; } else { line = this . buffer . slice ( 0 , 1 ) ; } this . readFrom = limit ; if ( limit < 0 ) { this . lastHead = Buffer . from ( line ) ; if ( this . bRead === this . size ) { this . isPaused = ! this . push ( this . lastHead ) ; } } else { this . isPaused = ! this . push ( line ) ; } } }
false, no more values are emitted until the flow is resumed.
false no more values are emitted until the flow is resumed .
// check if this stream has been paused (back-pressure) and if there // are indeed bytes to read // identify the occurrence of line breaks. // chances are that the first line we read is not complete // so we'll push it as part of the next read.