Skip to content

Instantly share code, notes, and snippets.

@fayimora
Created August 29, 2017 13:39
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 fayimora/5b91cb1e70c3ab15c51de9da4b48abe6 to your computer and use it in GitHub Desktop.
Save fayimora/5b91cb1e70c3ab15c51de9da4b48abe6 to your computer and use it in GitHub Desktop.
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
val x = 5
val y = 6
def makeFuture(text: String) = Future { println(text) }
for {
foo <- makeFuture("hi") if x == 5
bar <- makeFuture("yo") if y == 4
yar <- makeFuture("whattup")
} yield ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment