Last active
March 21, 2016 02:05
-
-
Save devth/c126a29dc84f60add0fa to your computer and use it in GitHub Desktop.
This file contains 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
object HouseBuilderAsync1 { | |
def circumference(d: Double): Future[Double] = Math.piSlow.map { _ * d } | |
def buildWindow(c: Double): Window = Window(c) | |
def buildHouse(window: Window): House = House(window) | |
} | |
object HouseControllerAsync1 { | |
import HouseBuilderAsync._ | |
circumference(10).map(buildWindow).map(buildHouse) | |
// scala.concurrent.Future[AsynsVsSync.House] = Success(House(Window(31.400000000000002))) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment