carryxyh closed pull request #2498: Optimize resultFuture callback
URL: https://github.com/apache/incubator-dubbo/pull/2498
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncRpcResult.java
 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncRpcResult.java
index 0ae9867dd0..b5b6a57f82 100644
--- 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncRpcResult.java
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncRpcResult.java
@@ -75,7 +75,7 @@ public AsyncRpcResult(CompletableFuture<Object> future, final 
CompletableFuture<
                     rpcResult = new RpcResult(v);
                 }
                 // instead of resultFuture we must use rFuture here, 
resultFuture may being changed before complete when building filter chain, but 
rFuture was guaranteed never changed by closure.
-                rFuture.complete(rpcResult);
+                resultFuture.complete(rpcResult);
             });
         }
         this.valueFuture = future;
@@ -133,7 +133,7 @@ public Object recreate() throws Throwable {
     }
 
     public void thenApplyWithContext(Function<Result, Result> fn) {
-        this.resultFuture = 
resultFuture.thenApply(fn.compose(beforeContext).andThen(afterContext));
+        
resultFuture.thenApply(fn.compose(beforeContext).andThen(afterContext));
     }
 
     @Override
@@ -161,6 +161,7 @@ public String getAttachment(String key, String 
defaultValue) {
         return getRpcResult().getAttachment(key, defaultValue);
     }
 
+    @Override
     public void setAttachment(String key, String value) {
         getRpcResult().setAttachment(key, value);
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to