Skip to content

Instantly share code, notes, and snippets.

@mmollaverdi
Created October 27, 2016 17:36
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 mmollaverdi/32f8197e6904c2767275a4becc57c1f7 to your computer and use it in GitHub Desktop.
Save mmollaverdi/32f8197e6904c2767275a4becc57c1f7 to your computer and use it in GitHub Desktop.
def map2[A, B, C](future1: Future[A], future2: Future[B])(combine: (A, B) => C): Future[C] = {
future1.zip(future2).map {
case (result1, result2) => combine(result1, result2)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment