February 2018
Intermediate to advanced
552 pages
13h 46m
English
The Scala Future API supports a couple of Scala combinators to ease the way of extracting values from a Future or a Promise object.
Let's explore some of the useful and important Scala Future API combinators in this section:
Let's explore Scala Future API combinators with some simple examples here:
scala> import scala.concurrent.Promiseimport scala.concurrent.Promisescala> import scala.concurrent.ExecutionContext.Implicits.globalimport scala.conct.ExecutionContext.Implicits.globalscala> val cityPromise = Promise[String]()cityPromise: scala.concurrent.Promise[String] = scala.concurrent.impl.Promise$DefaultPromise@7d07e6aascala> cityPromise.success("Hyderabad")res13: cityPromise.type ...Read now
Unlock full access