خرید بک لینک

Vote count: 0

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!

asked 29 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 15 تير 1395 ساعت: 6:07

صفحه بندی