MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / _parallel

Function _parallel

public/javascripts/async.js:713–728  ·  view source on GitHub ↗
(eachfn, tasks, callback)

Source from the content-addressed store, hash-verified

711 };
712
713 function _parallel(eachfn, tasks, callback) {
714 callback = callback || noop;
715 var results = _isArrayLike(tasks) ? [] : {};
716
717 eachfn(tasks, function (task, key, callback) {
718 task(_restParam(function (err, args) {
719 if (args.length <= 1) {
720 args = args[0];
721 }
722 results[key] = args;
723 callback(err);
724 }));
725 }, function (err) {
726 callback(err, results);
727 });
728 }
729
730 async.parallel = function (tasks, callback) {
731 _parallel(async.eachOf, tasks, callback);

Callers 1

async.jsFile · 0.85

Calls 3

_isArrayLikeFunction · 0.85
_restParamFunction · 0.85
callbackFunction · 0.85

Tested by

no test coverage detected