MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / pipeLoop

Function pipeLoop

examples/io/streams/modules/streams.js:821–833  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

819 // - Backpressure must be enforced
820 // - Shutdown must stop all activity
821 function pipeLoop() {
822 return new Promise((resolveLoop, rejectLoop) => {
823 function next(done) {
824 if (done) {
825 resolveLoop();
826 } else {
827 pipeStep().then(next, rejectLoop);
828 }
829 }
830
831 next(false);
832 });
833 }
834
835 function pipeStep() {
836 if (shuttingDown === true) {

Callers 1

ReadableStreamPipeToFunction · 0.85

Calls 1

nextFunction · 0.70

Tested by

no test coverage detected