GitHub user yulin2 opened a pull request:

    https://github.com/apache/cassandra/pull/50

    opinion on refactoring ListenableFuture to Java 8 CompletableFuture

    I'm doing research on new concurrent constructs in Java 8. I found 
`CompletableFuture` in Java 8 has the same functionality as Guava 
`ListenableFuture`. But `CompletableFuture` is much nicer because it comes 
together with Lambda expression in Java 8, and it is monadic, which makes the 
code more readable and cleaner. Also, it provides more ways to compose 
different tasks. Therefore, using `CompletableFuture` instead of 
`ListenableFuture` is better for future extension and maintenance of the code.
    
    I tried to refactoring one Guava `ListenableFuture` to Java 8 
`CompletableFuture` in Cassandra, so you can see the difference in the code. 
You don't have to merge this pull request. I'm just wondering your opinion on 
this kind of refactoring (or migrating the code from Java 7 to Java 8). Do you 
think the refactoring is useful? Do you have any plan to use Java 8?

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/yulin2/cassandra trunk

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cassandra/pull/50.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #50
    
----
commit 6b68f5479fc642d8342702f195bf05f6ca044d40
Author: Yu Lin <yu.lin...@gmail.com>
Date:   2014-12-31T19:44:03Z

    refactor one ListenableFuture to Java 8 CompletableFuture

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to