re: Reduce Promises memory usage in Node.js VIEW POST

re: Really interesting problem! Thanks for sharing! I don’t know if this is of any help, but here might be an alternative way to solving your problem...

Thanks for sharing your solution as well. I believe that what you did (take3subtake1part1) can be achieved by Bluebird's Promise.map with the concurrency option. From the docs:

"The concurrency limit applies to Promises returned by the mapper function and it basically limits the number of Promises created. For example, if concurrency is 3 and the mapper callback has been called enough so that there are three returned Promises currently pending, no further callbacks are called until one of the pending Promises resolves. So the mapper function will be called three times and it will be called again only after at least one of the Promises resolves."

code of conduct - report abuse