I read about Scala Futures and Promises.
I know that I can use callbacks, the flatMap
combinator or a for-comprehension to chain futures. When a future is completed, another future is started and so on.
Is there a way to chain the execution of an arbitrary number of futures, stored in a Scala Collection (for example a List
)?
I tried to invoke Future.sequence
on this list of futures but they start all together and they are executed concurrently (not sequentially).