Hi,
following Scala with Cats, I am wondering if two pieces of code below are the same or there is some difference:
val futures: Iterator[Future[B]] = …
Future.sequence(futures) map { iterable =>
iterable.foldLeft(Monoid[B].empty)(_ |+| _)
}
val futures: Iterator[Future[B]] = …
futures.foldLeft(Monoid[Future[B]].empty)(_ |+| _)
Are futures in second case still executed in parallel?
Thank you.
regards,
peter