You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/08/23 05:48:15 UTC

[GitHub] [dubbo] chickenlj commented on a change in pull request #8566: [3.0-tri-compiler] dubbo compiler support stream

chickenlj commented on a change in pull request #8566:
URL: https://github.com/apache/dubbo/pull/8566#discussion_r693676411



##########
File path: compiler/src/main/resources/Dubbo3InterfaceStub.mustache
##########
@@ -18,11 +18,37 @@ static final String SERVICE_NAME = "{{commonPackageName}}.{{serviceName}}";
     // FIXME, initialize Dubbo3 stub when interface loaded, thinking of new ways doing this.
     static final boolean inited = {{className}}.init();
 
-{{#methods}}
+{{#unaryMethods}}
+    {{#javaDoc}}
+        {{{javaDoc}}}
+    {{/javaDoc}}
+    {{#deprecated}}
+        @java.lang.Deprecated
+    {{/deprecated}}
     {{outputType}} {{methodName}}({{inputType}} request);
 
     CompletableFuture<{{outputType}}> {{methodName}}Async({{inputType}} request);
 
-{{/methods}}
+{{/unaryMethods}}
+
+{{#serverStreamingMethods}}
+    {{#javaDoc}}
+        {{{javaDoc}}}
+    {{/javaDoc}}
+    {{#deprecated}}
+        @java.lang.Deprecated
+    {{/deprecated}}
+    void {{methodName}}({{inputType}} request, org.apache.dubbo.common.stream.StreamObserver<{{outputType}}> responseObserver);
+{{/serverStreamingMethods}}
+
+{{#biStreamingMethods}}
+    {{#javaDoc}}
+        {{{javaDoc}}}
+    {{/javaDoc}}
+    {{#deprecated}}
+        @java.lang.Deprecated
+    {{/deprecated}}
+    org.apache.dubbo.common.stream.StreamObserver<{{inputType}}> {{methodName}}(org.apache.dubbo.common.stream.StreamObserver<{{outputType}}> responseObserver);
+{{/biStreamingMethods}}

Review comment:
       I think we should consider how the developers will use this before determining support of streaming interface:
   * For the consumer side, developers can call any of the `sync`, `async`, `streaming` methods from the proxy they get.
   * For the provider side, developers don't have to provider implementation for all methods, one bi-directional streaming implementation would be enough.




-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org