By Alvin Alexander. Last updated: August 21, 2017
As a quick note, if you need to see how to write a Scala method that returns a Future, this example may help:
def slowlyDouble(x: Int, delay: Int): Future[Int] = Future {
sleep(delay)
x * 2
}
I’m not going to write about this in detail here because I discuss it in my How to use multiple Scala Futures in a for-comprehension tutorial, so please see that link for more information.