Kue.singleton.types(function(err, types){ /* istanbul ignore next */ function getCountByType(type, done){ async.parallel({ inactive: function(cb){ Kue.singleton.card(type + ':inactive', cb) }, active: function(cb){ Kue.singleton.card(type + ':active', cb) }, complete: function(cb){ Kue.singleton.card(type + ':complete', cb) }, failed: function(cb){ Kue.singleton.card(type + ':failed', cb) }, delayed: function(cb){ Kue.singleton.card(type + ':delayed', cb) }, }, function parallelCb(err, results){ groupByTypes[type] = results done(err) }) } async.each(types, getCountByType, function(err){ callback(err, groupByTypes) }) })