Right now the Downloader() object uses recursion to iterate through the list. This is problematic because it will lead to a very large call stack unless you use a setImmediate() to break out of it (see: commit 747ce133f08bae4c637a74e8735946d5eb6af65c).
I do not like the setImmediate() approach because it feels like a code smell. So this object needs to be refactored to either replace the recursion with some flavor of simple iteration or the recursion needs to be implemented in such a way that it wont negatively impact the call stack or memory usage.
Right now the
Downloader()
object uses recursion to iterate through the list. This is problematic because it will lead to a very large call stack unless you use asetImmediate()
to break out of it (see: commit 747ce133f08bae4c637a74e8735946d5eb6af65c).I do not like the
setImmediate()
approach because it feels like a code smell. So this object needs to be refactored to either replace the recursion with some flavor of simple iteration or the recursion needs to be implemented in such a way that it wont negatively impact the call stack or memory usage.