Skip to content

Instantly share code, notes, and snippets.

@vigneshwaranr
Created February 14, 2021 07:36
Show Gist options
  • Save vigneshwaranr/957e0d4997ba1a2f834239c164b120b4 to your computer and use it in GitHub Desktop.
Save vigneshwaranr/957e0d4997ba1a2f834239c164b120b4 to your computer and use it in GitHub Desktop.
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