May 2017
Intermediate to advanced
414 pages
13h
English
For this recipe, we will need to perform the following steps:
import scala.concurrent.duration._ import scala.concurrent.{Await, Future} import scala.concurrent.ExecutionContext.Implicits.global
object AddFuture extends App { val future = Future(1+2).mapTo[Int] val sum = Await.result(future, 10 seconds) println(s"Future Result $sum") }
Read now
Unlock full access