question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Move from Guava ListenableFuture to Java 8 CompletableFuture

See original GitHub issue

Guava 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:closed
  • Created 7 years ago
  • Comments:29 (23 by maintainers)

github_iconTop GitHub Comments

1reaction
jkosh44commented, Dec 11, 2017

@keith-turner The indirection worked, just pushed the fix.

0reactions
jwonderscommented, Dec 13, 2017

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 the committed() status upon successful completion. The deleteLocks is an intermediate step that does its work then composes the result with the finishCommit step. Some steps might return immediately upon exceptional conditions and perform composition on normal conditions.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found