CrazyHZM commented on code in PR #14125:
URL: https://github.com/apache/dubbo/pull/14125#discussion_r1597004169


##########
dubbo-plugin/dubbo-reactive/src/main/java/org/apache/dubbo/reactive/ServerTripleReactorSubscriber.java:
##########
@@ -20,11 +20,24 @@
 import org.apache.dubbo.rpc.protocol.tri.CancelableStreamObserver;
 import org.apache.dubbo.rpc.protocol.tri.observer.CallStreamObserver;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+
 /**
  * The Subscriber in server to passing the data produced by user publisher to 
responseStream.
  */
 public class ServerTripleReactorSubscriber<T> extends 
AbstractTripleReactorSubscriber<T> {
 
+    private final List<T> collectedData = new ArrayList<>();
+    private final CompletableFuture<List<T>> completableFuture = new 
CompletableFuture<>();

Review Comment:
   1. Make naming `completableFuture` more meaningful.
   2. Why is List<T> type? Is combined future?



##########
dubbo-plugin/dubbo-reactive/src/main/java/org/apache/dubbo/reactive/AbstractTripleReactorSubscriber.java:
##########
@@ -53,7 +53,7 @@ public void subscribe(final CallStreamObserver<T> downstream) 
{
         if (downstream == null) {
             throw new NullPointerException();
         }
-        if (this.downstream == null && SUBSCRIBED.compareAndSet(false, true)) {
+        if (SUBSCRIBED.compareAndSet(false, true)) {

Review Comment:
   Please help optimize the code style. Thanks.



-- 
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]


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

Reply via email to