Hi,
I love how powerful for comprehensions are, but I came across a case where I have a dynamic list of futures that need to be executed in parallel and when everything is completed, I would like to process that and return some value, and was not sure how to handle this. Just to exemplify:
def handleFutures(futures: List[Future[Any]]) : Future[String] = {
for ( d1 <- futures(0)
d2 <- futures(1)
......
) yield { d1.toString + " : " + d2.toString + " : " + .... }
}
As I mentioned, all the futures should be executed in parallel here and need to handle error cases as well.
What would you guys recommend using here?
Thanks in advance.