How can I limit angular $q promise concurrency?
问题 How do I do something like $q.all but limiting how many promises are executed concurrently? My question is just like How can I limit Q promise concurrency? I want no more than 5 process spawned at a time The accepted answer for that other question is a library written for promise wrapped to work with Q. But I'm interested specifically in a solution for Angular's $q rather than for Q . Background: The problem being solved: I have a bunch of files to download in 2 steps: a) Get URL b) download