Quantcast
Channel: Scala map over a Future - Stack Overflow
Browsing all 2 articles
Browse latest 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 all 2 articles
Browse latest View live


Latest Images