Skip to content

Instantly share code, notes, and snippets.

@softberries
Created November 29, 2019 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save softberries/278216f54f3f43d0ff766fcf449c79a9 to your computer and use it in GitHub Desktop.
Save softberries/278216f54f3f43d0ff766fcf449c79a9 to your computer and use it in GitHub Desktop.
val fut = Future { println("hey!") }
val program: Future[Unit] =
for {
_ <- fut
_ <- fut
} yield ()
program.onComplete {
case Success(value) => value
case Failure(exception) => println(exception.getMessage)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment