index.js
function flush(done) {
    this.once('done', done);

    if (this._res.finished) {
      this.emit('done', new Error('Response was closed, unable to flush content'));
    }

    if (!this._queue.length) this.emit('done');
    var data = new Buffer(this.join(), this.charset);

    if (data.length) {
      this.debug('Writing %d bytes of %s to response', data.length, this.charset);
      this._res.write(data, this.emits('done'));
    }

    //
    // Optional write confirmation, it got added in more recent versions of
    // node, so if it's not supported we're just going to call the callback
    // our selfs.
    //
    if (this._res.write.length !== 3 || !data.length) this.emit('done');
  }
function flush(done) {
    this.once('done', done);

    if (this._res.finished) {
      this.emit('done', new Error('Response was closed, unable to flush content'));
    }

    if (!this._queue.length) this.emit('done');
    var data = new Buffer(this.join(), this.charset);

    if (data.length) {
      this.debug('Writing %d bytes of %s to response', data.length, this.charset);
      this._res.write(data, this.emits('done'));
    }

    //
    // Optional write confirmation, it got added in more recent versions of
    // node, so if it's not supported we're just going to call the callback
    // our selfs.
    //
    if (this._res.write.length !== 3 || !data.length) this.emit('done');
  }
function flush ( done ) { this . once ( 'done' , done ) ; if ( this . _res . finished ) { this . emit ( 'done' , new Error ( 'Response was closed, unable to flush content' ) ) ; } if ( ! this . _queue . length ) this . emit ( 'done' ) ; var data = new Buffer ( this . join ( ) , this . charset ) ; if ( data . length ) { this . debug ( 'Writing %d bytes of %s to response' , data . length , this . charset ) ; this . _res . write ( data , this . emits ( 'done' ) ) ; } // // Optional write confirmation, it got added in more recent versions of // node, so if it's not supported we're just going to call the callback // our selfs. // if ( this . _res . write . length !== 3 || ! data . length ) this . emit ( 'done' ) ; }
Flush all queued rendered pagelets to the request object.

@returns {Pagelet} this
@api private
Flush all queued rendered pagelets to the request object .