io.rouz.grpc.examples.chat.ChatServiceStubExt.kt Maven / Gradle / Ivy
package io.rouz.grpc.examples.chat
import io.rouz.grpc.*
import io.rouz.grpc.examples.chat.ChatServiceGrpc.ChatServiceStub
import kotlinx.coroutines.channels.ReceiveChannel
import kotlin.coroutines.suspendCoroutine
/**
* Kotlin extension functions for [io.rouz.grpc.examples.chat.ChatServiceGrpc.ChatServiceStub]
*
* Generated by gRPC Kotlin generator
* Source: chat.proto
*/
fun ChatServiceStub.chat(): ManyToManyCall {
val responseChannel = StreamObserverChannel()
val requestObserver = chat(responseChannel)
return ManyToManyCall(requestObserver, responseChannel)
}
inline suspend fun ChatServiceStub.getNames(request: com.google.protobuf.Empty): io.rouz.grpc.examples.chat.ChatRoom {
return suspendCoroutine {
getNames(request, ContinuationStreamObserver(it))
}
}