Vote count: 0 I'd like to port libraries to Java 8. At the moment I have blocking http operations, and the caller needs to care about this problem. When I port my library to java 8, I am thinking of changing the method signatures not to retu just Response, but instead to retu CompletableFuture. For this to be possible the constructor of my main library class would need to take a third argument: An Executor or ExecutorService, so they have control about pool sizes, shutdown() etc. I have seen many tutorials which discuess how CompletableFuture works, but none of them is dealing with the question whether a libary should retu those objects or let the caller deal with async "problems". Another d...
ادامه مطلب