Closed
Description
val x = future { someExpensiveComputation() }
val y = future { someOtherExpensiveComputation() }
val z = for (a <- x; b <- y) yield a*b
for (c <- z) println("Result: " + c)
println("Meanwhile, the main thread goes on!")
from the sources:
@deprecated("use `Future { ... }` instead", "2.11.0")
// removal planned for 2.13.0
def future[T](body: =>T)
The future
usage should probably be replaced with Future { }
in this example (and its description). If you think it's a good idea, I can prepare a PR in no time :)
Metadata
Metadata
Assignees
Labels
No labels