MCPcopy
hub / github.com/parallel-js/parallel.js / done

Function done

lib/parallel.js:278–287  ·  view source on GitHub ↗
(err, wrk)

Source from the content-addressed store, hash-verified

276 let startedOps = 0;
277 let doneOps = 0;
278 function done(err, wrk) {
279 if (err) {
280 newOp.resolve(err, null);
281 } else if (++doneOps === that.data.length) {
282 newOp.resolve(null, that.data);
283 if (wrk) wrk.terminate();
284 } else if (startedOps < that.data.length) {
285 that._spawnMapWorker(startedOps++, cb, done, env, wrk);
286 } else if (wrk) wrk.terminate();
287 }
288
289 var newOp = new Operation();
290 this.operation.then(

Callers 3

parallel.jsFile · 0.85
q-api.spec.jsFile · 0.85
api.spec.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected