Scala is a general purpose multi-paradigm programming language that includes characteristics of object-oriented and functional programming. Its code is compiled to Java byte code. It provides Java interoperability, so you can use elements of Java (including the Java Concurrency API) in Scala code and libraries written in Scala in Java programs.
As we mentioned with Clojure and Groovy, the main purpose of this section is not to provide an introduction to the Scala programming language and its installation and configuration. You can download the tools to work in Scala from https://www.scala-lang.org/. You can install a plug-in to get support for Scala in your IDE. Eclipse, for example, has the Scala IDE plug-in that you can install via the Eclipse Marketplace.
The Scala concurrency model is based on Futures and Promises. A future stores a value that doesn't exist yet and will be calculated by an asynchronous task that will be executed by another thread. A
Future uses a non...