Quantcast
Channel: Scala map over a Future - Stack Overflow
Browsing latest articles
Browse All 2 View Live

Answer by tharindu_DG for Scala map over a Future

It depends.val someFuture = Future { 1+1 }.map(elem => { println("mapping immediately") elem.toString})someFuture will be executed eagerly and the println will be executed.someFuture.onComplete {...

View Article



Scala map over a Future

In the following example, what is the expected behaviour?import scala.concurrent.ExecutionContext.Implicits.globalval someFuture = Future { 1+1 }.map(elem => { println("mapping immediately")...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images