Say I have:
val a: Future[A]
val b: Future[B]
And I want to combine them into:
val y: Future[(Try[A], Try[B])]
How can I do that?
There is a method zip
on Future
, but that gives Future[(A, B)]
, i.e. it fails if either a
or b
fails, thus potentially losing information.