[ 
https://issues.apache.org/jira/browse/KAFKA-6018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16194414#comment-16194414
 ] 

ASF GitHub Bot commented on KAFKA-6018:
---------------------------------------

GitHub user steven-aerts opened a pull request:

    https://github.com/apache/kafka/pull/4033

    KAFKA-6018: Make KafkaFuture.Future an interface

    Changing KafkaFuture.Future and KafkaFuture.BiConsumer into an interface 
makes
    them a functional interface.  This makes them Java 8 lambda compatible.

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

    $ git pull https://github.com/steven-aerts/kafka-1 KAFKA-6018

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

    https://github.com/apache/kafka/pull/4033.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 #4033
    
----
commit 6c630aff48954558b8ad6e2611cf0c269b879287
Author: Steven Aerts <[email protected]>
Date:   2017-10-06T10:16:41Z

    KAFKA-6018 Make KafkaFuture.Future an interface
    
    Changing KafkaFuture.Future and KafkaFuture.BiConsumer into an interface 
makes
    them a functional interface.  This makes them Java 8 lambda compatible.

----


> Make KafkaFuture.Function java 8 lambda compatible
> --------------------------------------------------
>
>                 Key: KAFKA-6018
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6018
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>            Reporter: Steven Aerts
>
> KafkaFuture.Function is currently an empty public abstract class.
> This means you cannot implement them as a java lambda.  And you end up with 
> constructs as:
> {code:java}
> new KafkaFuture.Function<Set<String>, Object>() {
>     @Override
>     public Object apply(Set<String> strings) {
>         return foo;
>     }
> }
> {code}
> I propose to define them as interfaces.
> So this code can become in java 8:
> {code:java}
> strings -> foo
> {code}
> I know this change is backwards incompatible (extends becomes implements).
> But as {{KafkaFuture}} is marked as {{@InterfaceStability.Evolving}}.
> And KafkaFuture states in its javadoc:
> {quote}This will eventually become a thin shim on top of Java 8's 
> CompletableFuture.{quote}
> I think this change might be worth considering.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to