Improve unary server stub
- Dominant language
- Java
- Stars
- 12.1k
- Forks
- 4k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 37
Description
The Java unary stub is taking the form of an async service, where a single result is expected to return from a StreamObserver.
This can be error prone:
- You can't tell from the stub whether it's unary or streaming multiple results
- The code can easily call onNext one too many times, or not call onComplete
Unary gRPC stubs for several other stubs expects a single return value from the method. Java should follow the same convention:
https://github.com/grpc/grpc/blob/master/examples/python/helloworld/greeter_server.py
https://github.com/grpc/grpc/blob/master/examples/ruby/greeter_server.rb
https://github.com/grpc/grpc-go/blob/master/examples/helloworld/greeter_server/main.go
Contributor guide
Assessment
This issue has not been assessed yet.