Created
August 17, 2016 14:55
-
-
Save sergiilagutin/3a07ec7cebeeb62bd56d292d1b5843e5 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.concurrent.Future | |
| def future1(): Future[Int] = ??? | |
| def future2(): Future[Int] = ??? | |
| val z1 = for { | |
| x <- future1() | |
| y <- future2() | |
| } yield x + y | |
| val f1 = future1() | |
| val f2 = future2() | |
| val z2 = for { | |
| x <- f1 | |
| y <- f1 | |
| } yield x + y | |
| // z1 vs z2 ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment