Created
February 14, 2021 07:36
-
-
Save vigneshwaranr/957e0d4997ba1a2f834239c164b120b4 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.Future | |
trait WaterSupply { | |
def turnOn(): Future[Unit] | |
} | |
trait PowerPlant { | |
def waterSupply: WaterSupply | |
def increaseVolumeControl(): Future[Boolean] | |
def turnOn(): Future[Boolean] = { | |
waterSupply.turnOn() | |
increaseVolumeControl() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment