This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Spawn your futures | |
val fs = (1 to 100).map { i => | |
Future { Thread.sleep(i); i } | |
} | |
// Wrap all of the work up into a single | |
// Future | |
val f = Future.sequence(fs) | |
// Wait on it forever - i.e. until it's done |