rouzwawi / grpc-kotlin

gRPC with Kotlin Coroutines
https://gitter.im/gRPC-Kotlin/Lobby
Apache License 2.0
220 stars 23 forks source link

Generate client stub code as extension functions on original Java stub #24

Closed rouzwawi closed 6 years ago

rouzwawi commented 6 years ago

The stub adapters are pretty straight forward and do not really need to be a class. This PR moves all the generated client code to a set of extension function on the original Java stub class.

Users should not simply instantiate a regular Java stub where earlier the Kotlin stub was generated.

-  val greeter = GreeterGrpcKt.newStub(channel)
+  val greeter = GreeterGrpc.newStub(channel)