dugenkui03 commented on issue #3973:
URL: https://github.com/apache/rocketmq/issues/3973#issuecomment-1092563683

   Not convert `Future` to `CompletableFuture`, but implements 
`#sendAsync(Message)` which return `CompletableFuture`.
   
   # Describe in Chinese
   
并非将`Future`转换成`CompletableFuture`,而是在`Producer`中实现`#sendAsync(Message)`方法的时候将返回结果修改为`CompletableFuture`,**甚至`Future`任意的实现**,例如返回
 `guava-ListenableFuture` 已使用jdk8的`CompletableFuture`中没有的特性。
   
   ```java
   public interface Producer {
   
       ......
   
       Future<SendReceipt> sendAsync(Message message);
   
   }
   
   public class DefaultProducer {
   
       ......
   
       CompletableFuture<SendReceipt> sendAsync(Message message){
                  // 具体的实现,CompletableFuture 其逻辑的确依赖
              ......
       }
   
   }
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to