scala - transforming a Seq[Future[X]] into an Enumerator[X] -
What's the difference between a future [X]]? The case of use is that I want to crawl the web and get resources. It is going to return the sequence of futures, and I want to return a calculator which will push future futures into that sequence in which they end up in the Ittea for the first time.
It seems that Victor Klang can be used to do this - although it looks quite disabled
Note: In the question of Iteratees and calculator, Version 2.x, which means that with the following import: : I can get it with the import play.api.libs.iteratee ._
/ ** * Close the first future" Choose "satisfied. Return it as a result, in the form of a sequence with the remainder of the futures. * @ @ Ultimate FS Single Scale Collection.Sec * / def [A] (fs: Seq [future [A]] (implicit EC: execution containbox): future [(try [a], seak [future [a]]] = {@ skala Try the trickler DRP strip (P: promise) [([A], Seek [future [A]], head: Seek [future [A]], AMM: Future [A], tail: SAC [future [A]]: Future [(try [a], seak [future [a]]) = {end at amm {rss = & gt; If (! P.isCompleted) p.trySuccess ((Res, head ++ tail)) if (tail.iscti) p.future other bar (P, head: + elem, tail.head, tail.tail)} if (Fs.isEmpty) Future.failed (new invalid record exceptions ("empty future list!") Second bar (promise), fs.genericbuilder [future [a]] result, fs.head, fs.tail)} }
enumerator. InfoldM {initial sequfuation AS} {seqOfFutureAs = & gt; If (CACofficialisISTAT) (Future (None)} Other {FutureUtili.CelectFaccessAs.Map {Case (T, Sequfecture) = & gt; T.toOption.map {a => (SeqFuture, a)}} }}
Comments
Post a Comment