MCPcopy
hub / github.com/di-sukharev/opencommit / parallel

Function parallel

out/cli.cjs:24503–24519  ·  view source on GitHub ↗
(list, iterator2, callback)

Source from the content-addressed store, hash-verified

24501 var terminator = require_terminator();
24502 module2.exports = parallel;
24503 function parallel(list, iterator2, callback) {
24504 var state2 = initState(list);
24505 while (state2.index < (state2["keyedList"] || list).length) {
24506 iterate(list, iterator2, state2, function(error, result) {
24507 if (error) {
24508 callback(error, result);
24509 return;
24510 }
24511 if (Object.keys(state2.jobs).length === 0) {
24512 callback(null, state2.results);
24513 return;
24514 }
24515 });
24516 state2.index++;
24517 }
24518 return terminator.bind(state2, callback);
24519 }
24520 }
24521});
24522

Callers

nothing calls this directly

Calls 3

iterateFunction · 0.85
callbackFunction · 0.85
keysMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…