rouzwawi / grpc-kotlin

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

Use ProducerScope for server streaming calls #13

Closed rouzwawi closed 6 years ago

rouzwawi commented 6 years ago

This switches the signature on server streaming handlers to be executed within a ProducerScope<TReply>.

-  override suspend fun greetServerStream(request: TRequest) = produce<TReply> { ... }
+  override suspend fun ProducerScope<TReply>.greetServerStream(request: TRequest) { ... }

It also makes exception propagation more consistent across the various rpc types by always following these rules: