I am building a module using Promises, where I make multiple http calls on multiple urls, parse the responses and then again make more http calls.
c = new RSVP.Promise({urls:[]}) //Passing a list of urls
c.then(http_module1) // Call the http module
.then(parsing_module) // Parsing the responses and extract the hyperlinks
.then(http_module2) // Making http requests on the data produced by the parser before.
.then(print_module) // Prints out the responses.
The problem is that - If I use a promise, I can not parse the modules unless all the http requests are made. This is because - Once a promise has been resolved or rejected, it cannot be resolved or rejected again.
Build my own version of promises or is there an alternate approach?