You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "cvictory (GitHub)" <gi...@apache.org> on 2018/12/03 03:25:55 UTC

[GitHub] [incubator-dubbo] cvictory opened issue #2868: In dubbo-2.7.0, @DubboAsync generating another interface is right?

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

[GitHub] [incubator-dubbo] chickenlj commented on issue #2868: In dubbo-2.7.0, @DubboAsync generating another interface is best way?

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
> It will generate two interface.
If we can merge two interfaces into GreetingService, such as:
```java
@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);
           });				
    }
}
```

Now, `@DubboAsync` and `@AsyncFor` have been removed from the core. See [here](https://github.com/dubbo/dubbo-async-processor/blob/master/README.md) for details

[ 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


[GitHub] [incubator-dubbo] mercyblitz commented on issue #2868: In dubbo-2.7.0, @DubboAsync generating another interface is best way?

Posted by "mercyblitz (GitHub)" <gi...@apache.org>.
Good question.

[ 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


[GitHub] [incubator-dubbo] chickenlj closed issue #2868: In dubbo-2.7.0, @DubboAsync generating another interface is best way?

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
[ issue closed by chickenlj ]

[ 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