Created
December 19, 2015 14:44
-
-
Save blizzarddreams/cd65836b52da015fc12c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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