Futures.awaitAll replacement in Scala 2.10
Asked Answered
L

1

7

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?

Lymphocytosis answered 2/3, 2013 at 19:2 Comment(0)
F
13

Use Future.sequence to turn many independent Futures into one that will not complete until all those constituents complete.

Fico answered 2/3, 2013 at 19:19 Comment(1)
Await.result(Future.sequence(fts), timeout.millis) is significantly different from Futures.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

© 2022 - 2024 — McMap. All rights reserved.