Move from Guava ListenableFuture to Java 8 CompletableFuture
See original GitHub issueGuava Futures and ListenableFuture was used for the async commit changes. Now that we have switched to java 8, should look in to using CompletableFuture. Also Futures in marked @Beta
in guava, so it could change in incompatible ways or be dropped in the future.
Issue Analytics
- State:
- Created 7 years ago
- Comments:29 (23 by maintainers)
Top Results From Across the Web
Howto migrate from guava's Listenablefuture to java8 ...
This is a one way mapping. If you used to use Guava futures, you probably want to do the java 8 equivalent. This...
Read more >The ultimate guide to Futures in Java and Guava
This method allows you to register listeners that are called once the future completes. Albeit they do not directly get the result, you...
Read more >Converting google/guava ListenableFuture to Java 8 ...
Following is one possible way to do it. The toCompletableFuture method just attaches a callback to listenableFuture which returns a ...
Read more >Listenablefuture vs Completablefuture - java - Stack Overflow
Both ListenableFuture and CompletableFuture have an advantage over its parent class Future by allowing the caller to "register" in one way ...
Read more >CompletableFuture vs ListenableFuture - Google Groups
To report an issue: https://github.com/google/guava/issues/new ... Afaik, the only feature of FluentFuture that is not supported by Java 8 CompletableFuture ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@keith-turner The indirection worked, just pushed the fix.
The purpose of
AsyncCommitResult
is to capture the result of the async operation. Terminal steps would be able to create a concrete value of this result class because they are aware of successful completion or errors. Intermediate steps would return a future based on additional composed async steps.In the code I had posted, the
finishCommit
method is a terminal step that returns thecommitted()
status upon successful completion. ThedeleteLocks
is an intermediate step that does its work then composes the result with thefinishCommit
step. Some steps might return immediately upon exceptional conditions and perform composition on normal conditions.