Endre Deak
05/28/2024, 10:58 PM// proto:
service MyService {
rpc foo(string) returns (string) {}
}
// generated abstract stub:
public abstract class MyServiceCoroutineImplBase(
coroutineContext: CoroutineContext = EmptyCoroutineContext,
) : AbstractCoroutineServerImpl(coroutineContext) {
public open suspend fun foo(request: String): String = throw
StatusException(UNIMPLEMENTED.withDescription("Method foo is unimplemented"))
}
// my binding:
class MyServiceBinding : MyServiceGrpcKt.MyServiceCoroutineImplBase() {
override suspend fun foo(request: String): String = "hello $request"
}
One thing I could see is that there could be gradle plugins generating the stubs using the new kotlinx.rpc
library.
What else do you see? How could this be used in a distributed environment with multiple rpc services and with shared protobuf messages?Alexander Sysoev
05/31/2024, 10:22 AM