Skip to content

Instantly share code, notes, and snippets.

View maxio89's full-sized avatar

Piotr Kozlowski maxio89

  • Poland
View GitHub Profile
// 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