grpc / grpc/grpc-java

Improve client stream server side stub

Open
#1,475 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
12.1k
Forks
4k
Avg merge
2d 17h
Merged PRs (30d)
37

Description

Looking at this:
https://github.com/grpc/grpc-java/blob/master/examples/src/main/java/io/grpc/examples/routeguide/RouteGuideServer.java#L187

This is super weird to have the "request input", Points, as a return value of a method, and the response RouteSummary, to be the input parameter of a method. I took a look at this for a while to figure out what's going on. I see it is forcing the implementation of StreamObserver interface to process the incoming Points, and thus requiring it to be a return value. I wonder if there is a better way of doing this.

Every other language stubs seems to generate sensible stubs where the input steam is in fact the parameter and not a return value, and they actually returns the actual RouteSummary as the return value of the method.
https://github.com/grpc/grpc-go/blob/master/examples/route_guide/server/server.go#L102
https://github.com/grpc/grpc/blob/master/examples/node/route_guide/route_guide_server.js#L156
https://github.com/grpc/grpc/blob/master/examples/python/route_guide/route_guide_server.py#L93
https://github.com/grpc/grpc/blob/master/examples/ruby/route_guide/route_guide_server.rb#L144

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.