dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cvictory (GitHub) <git...@apache.org>
Subject [GitHub] [incubator-dubbo] cvictory opened issue #2868: In dubbo-2.7.0, @DubboAsync generating another interface is right?
Date Mon, 03 Dec 2018 03:25:55 GMT
In dubbo-2.7.0,  @DubboAsync will generate another interface. 
For original interface ,
```
@DubboAsync
public interface GreetingsService {
    String sayHi(String name);
}
```
will generate another interface:
```
@Generated("com.alibaba.dubbo.async.processor.AsyncAnnotationProcessor")
@AsyncFor(com.alibaba.dubbo.samples.api.GreetingsService.class)
public interface GreetingsServiceAsync extends GreetingsService {
    CompletableFuture<java.lang.String> sayHiAsync(java.lang.String name);
}
```
It will generate two interface.
If we can merge two interfaces into GreetingService, such as:
```
@Generated("com.alibaba.dubbo.async.processor.AsyncAnnotationProcessor")
@AsyncFor(com.alibaba.dubbo.samples.api.GreetingsService.class)
public interface GreetingsService {
    String sayHi(String name);
   // this is for async, just show, no test.
    default CompletableFuture<java.lang.String> sayHiAsync(final java.lang.String name){
           return CompletableFuture.supplyAsync(() -> { 
                      return sayHi(name);
           });				
    }
}
```




[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2868 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
Mime
View raw message