Suppose, I have an abstract "producer" instance:
trait Producer[T] { def listObjectIds: Future[Seq[String]] def getObject(id: String): Future[T] } and I need to apply some processing to each (or some) of the objects it yields. So, I do something like:
producer .listObjectIds .map(maybeFilter) .map(_.map(producer.getObject)) ... and end up with Future[Seq[Future[T]]] This is ok, but kinda cumbersome. I would like to get rid of the outer Future, and just have Seq[Future[T]], but can't think of a (non-blocking) transformation, that would let me do that.
Any ideas?