Skip to content

Instantly share code, notes, and snippets.

@blizzarddreams
Created December 19, 2015 14:44
Show Gist options
  • Select an option

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

Select an option

Save blizzarddreams/cd65836b52da015fc12c to your computer and use it in GitHub Desktop.
import scala.concurrent.ExecutionContext.Implicits.global
import scala.actors.Future
import scala.concurrent.Future
import scala.util.{Failure, Success, Random}
// Yes I know not every import is used
object LearningFuture extends App {
val f = Future {
for (i <- 1 to 10) {
println("Hello")
}
"Done"
}
for (i <- 1 to 10) {
println("World")
}
f.onSuccess {
case e => println(e)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment