Skip to content

Commit

Permalink
Merge pull request #821 from megawac/series-parallel
Browse files Browse the repository at this point in the history
Implement series via _parallel
  • Loading branch information
aearly committed Jul 2, 2015
2 parents ac170ba + 5fdc96a commit ea84790
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,21 +720,8 @@
_parallel(_eachOfLimit(limit), tasks, callback);
};

async.series = function (tasks, callback) {
callback = callback || noop;
var results = _isArrayLike(tasks) ? [] : {};

async.eachOfSeries(tasks, function (task, key, callback) {
task(_restParam(function (err, args) {
if (args.length <= 1) {
args = args[0];
}
results[key] = args;
callback(err);
}));
}, function (err) {
callback(err, results);
});
async.series = function(tasks, callback) {
_parallel(async.eachOfSeries, tasks, callback);
};

async.iterator = function (tasks) {
Expand Down

0 comments on commit ea84790

Please sign in to comment.