I need to spawn set of Futures and wait untill all of them complete either with failure or with some success.
The recent Scala 2.10 doesn't contain anything like that or I did miss something?
I need to spawn set of Futures and wait untill all of them complete either with failure or with some success.
The recent Scala 2.10 doesn't contain anything like that or I did miss something?
Use Future.sequence
to turn many independent Future
s into one that will not complete until all those constituents complete.
© 2022 - 2024 — McMap. All rights reserved.
Await.result(Future.sequence(fts), timeout.millis)
is significantly different fromFutures.awaitAll(timeout, fts: _*)
, though, right? Because if one of the futures times out, you don't have a way to get the results of the futures that completed. – Rattlebrained