How do I do a for comprehension (or flatmaps) that mixes Futures and non-futures that retus a Future result? An example:
private def fetchWSResponseBodies(futureSetLongs: Future[Set[Long]]) = {
for {
setLongs: Set[Long] <- futureSetLongs
long: Long <- setLongs // Mulitple longs
wsRespone: Future[WSResponse] <- ws.url(s"someURL/$long").get
} yield {
wsRespone.body // want to retu a set of futures of Strings for the response bodies}
}
}
I'm having difficult figuring out how to extrapolate this logic into non-blocking code using flatmaps/maps or anything else. Help appreciated!
