What you're asking for doesn't really make sense. An array of promises (such as that you'd pass to Q.all) is an array of tasks that have already been started. Waiting on them to resolve is, to all intents and purposes, free. Waiting on them one at a time, versus in parallel has very little difference (one has slightly fewer turns of the event loop). It's when you call the functions that you begin the tasks, so what you really need to do is throttle how many times you call the function simultaniously:
You could try something like this:
```
function throttle(functions, max) {
var def = Q.defer();
var result = [];
var running = 0;
var waitingAt;
function next(i) {
if (running > max) {
waitingAt = i;
} else if (i < functions.length) {
var res = functions[i]();
result.push(res);
res.then(completeTask, completeTask);
} else {
def.resolve(Q.all(result));
}
}
next(0);
function completeTask() {
if (waitingAt) {
next(waitingAt);
waitingAt = null;
}
}
return def.promise;
}
```
I haven't tested it, but it should take an array of functions and a max-concurrency value, then execute up to max of them in parallel and return a promise for an array of the results.