I'm trying to call Futures.awaitAll with a variable number of well...Futures. awaitAll is defined as awaitAll(timeout : Long, fts : Future[Any]*)
. I have tried passing in a List and an Array but both won't work:
list = future1 :: future2 :: Nil
Futures.awaitAll(1000, list)
found : List[scala.actors.Future[Any]] required: scala.actors.Future[Any]
EDIT: What I now want to do is call Futures.awaitAll programmatically with a variable number of arguments (1 to n). So using Futures.awaitAll(1000, future1, future2) is not an option.
Chapter 8.8 of Programming in Scala didn't give me any hints how to solve this either, so help is welcome :)