We will discuss one of the important topics such as the differences between a Scala Future and a Java Future in this section:
- A Java Future works in a synchronous blocking way. It does not work in an asynchronous non-blocking way, whereas a Scala Future works in an asynchronous non-blocking way.
- If we want an asynchronous non-blocking feature, we should use Java 8's CompletableFuture. However, if we observe the CompletableFuture code, it is a bit clumsy, not elegant, and not concise, unlike that of Scala's Future. It is a bit tough to reason with.
- Scala Futures support very elegant and concise ways of writing concurrency code and support Concurrency and true Parallelism, very well. Java Futures/CompletableFutures support Concurrency, but do not support true Parallelism.
What is true Parallelism really?
True Parallelism means supporting...