Scala Future vs Java Future

 
Java Future is blocking because it waits if necessary for the computation to complete, and then retrieves its result.
 
Scala Future on the other hand is a real non-blocking computation. You can map the callbacks or chain multiple Futures in monadic fashion.
 
Java 8 has CompletableFuture which implements a Promise (CompletionStage). It can be non-blocking by attaching callbacks. (http://www.deadcoderising.com/java8-writing-asynchronous-code-with-completablefuture/) The code however is more convoluted compared to Scala.
Advertisements

Yangon Heritage Strategy from the Yangon Heritage Trust

The Yangon Heritage Trust today unveiled its eagerly-awaited “Yangon Heritage Strategy“. The 150 page document, complete with many maps and illustrations, outlines the Trust’s vision and strategy towards making Yangon Asia’s most liveable city through sustainable development and heritage conservation.

Continue reading