packages/mesh/lib/streams/std/readable-stream.js
function pipeLoop() {
        currentWrite = Promise.resolve();

        if (shuttingDown === true) {
          return Promise.resolve();
        }

        return writer._readyPromise.then(() => {
          return ReadableStreamDefaultReaderRead(reader).then(({ value, done }) => {
            if (done === true) {
              return undefined;
            }

            currentWrite = WritableStreamDefaultWriterWrite(writer, value);
            return currentWrite;
          });
        })
        .then(pipeLoop);
      }
function pipeLoop() {
        currentWrite = Promise.resolve();

        if (shuttingDown === true) {
          return Promise.resolve();
        }

        return writer._readyPromise.then(() => {
          return ReadableStreamDefaultReaderRead(reader).then(({ value, done }) => {
            if (done === true) {
              return undefined;
            }

            currentWrite = WritableStreamDefaultWriterWrite(writer, value);
            return currentWrite;
          });
        })
        .then(pipeLoop);
      }
function pipeLoop ( ) { currentWrite = Promise . resolve ( ) ; if ( shuttingDown === true ) { return Promise . resolve ( ) ; } return writer . _readyPromise . then ( ( ) => { return ReadableStreamDefaultReaderRead ( reader ) . then ( ( { value , done } ) => { if ( done === true ) { return undefined ; } currentWrite = WritableStreamDefaultWriterWrite ( writer , value ) ; return currentWrite ; } ) ; } ) . then ( pipeLoop ) ; }
Using reader and writer, read all chunks from this and write them to dest - Backpressure must be enforced - Shutdown must stop all activity
Using reader and writer read all chunks from this and write them to dest - Backpressure must be enforced - Shutdown must stop all activity