ListenableFuture vs CompletableFuture – a comparison

In my previous blog post I wrote about how Google Guava’s ListenableFuture is an improvement over Java 6’s Future class. But Java 8 ships with a CompletableFuture class that brings much of the same benefits into the standard Java API. The below code example (again with inline comments) shows how to use CompletableFuture to implement…… Continue reading ListenableFuture vs CompletableFuture – a comparison

How is Google Guava ListenableFuture better than Java Future?

Google Guava’s concurrency classes provide some advantages over using Java’s default classes. Guava’s Futures offer the following benefits: You can add “listeners” to the result of a Future’s success or failure, instead of explicitly checking for the return of the Future.get(), handling exceptions and so onYou can chain multiple asynchronous pieces of code together using…… Continue reading How is Google Guava ListenableFuture better than Java Future?