Closed
Description
JDK 8 introduces a composable standard Future called CompletableFuture[1]. Even through it will be a pain to support this while retaining backwards compatibility, adding support for this standard future is very important when designing complete async systems. It enables the same returned Future to be reused, composed[2] and simplifies the usage of AsyncHttpClient.
Example usage:
asyncHttpClient.prepareGet(url)
.exceuteJava8Style()
.thenApply(res -> doStuff(res))
.exceptionally(e -> log.error("Got exception", e));
[1] http://download.java.net/jdk8/docs/api/java/util/concurrent/CompletableFuture.html
[2] http://nurkiewicz.blogspot.dk/2013/05/java-8-completablefuture-in-action.html