Skip to content

Instantly share code, notes, and snippets.

@blizzarddreams
Created December 20, 2015 02:59
Show Gist options
  • Select an option

  • Save blizzarddreams/aebd9d95dbd8a1f68742 to your computer and use it in GitHub Desktop.

Select an option

Save blizzarddreams/aebd9d95dbd8a1f68742 to your computer and use it in GitHub Desktop.
import scala.concurrent._
import ExecutionContext.Implicits.global
import scala.concurrent.duration._
object Dog extends App {
def go() = {
val futures = List(
Future { for(i <- 1 to 10) println("A")},
Future { for(i <- 1 to 10) println("B")},
Future { for(i <- 1 to 10) println("C")}
)
Future.sequence(futures)
}
Await.result(go, Duration.Inf)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment