ListenableFuture
has been created since Spring 4.0. Although Spring 4.0 supported Java 8, the minimum requirement was Java 6, so the existence of ListenableFuture
is understandable. However, since 5.0, Spring requires Java 8 as a minimum.
Java 8 includes CompletableFuture
which can replace ListenableFuture
.
Without knowing this history, it can be confusing why ListenableFuture
exists. What do you think about removing ListenableFuture
?
Comment From: poutsma
If we change all methods that use ListenableFuture
to CompletableFuture
, we would force all consumers of these methods to change their code as well. We try not to break backwards compatibility without a very good reason.