ServerCalls

object ServerCalls

Helpers for implementing a gRPC server based on a Kotlin coroutine implementation.

Functions

bidiStreamingServerMethodDefinition
Link copied to clipboard
Creates a ServerMethodDefinition that implements the specified bidirectional-streaming RPC method by running the specified implementation and associated implementation details within a per-RPC CoroutineScope generated with the specified CoroutineContext.
clientStreamingServerMethodDefinition
Link copied to clipboard
fun <RequestT, ResponseT> clientStreamingServerMethodDefinition(context: CoroutineContext, descriptor: MethodDescriptor<RequestT, ResponseT>, implementation: suspend (requests: Flow<RequestT>) -> ResponseT): ServerMethodDefinition<RequestT, ResponseT>
Creates a ServerMethodDefinition that implements the specified client-streaming RPC method by running the specified implementation and associated implementation details within a per-RPC CoroutineScope generated with the specified CoroutineContext.
serverStreamingServerMethodDefinition
Link copied to clipboard
Creates a ServerMethodDefinition that implements the specified server-streaming RPC method by running the specified implementation and associated implementation details within a per-RPC CoroutineScope generated with the specified CoroutineContext.
unaryServerMethodDefinition
Link copied to clipboard
fun <RequestT, ResponseT> unaryServerMethodDefinition(context: CoroutineContext, descriptor: MethodDescriptor<RequestT, ResponseT>, implementation: suspend (RequestT) -> ResponseT): ServerMethodDefinition<RequestT, ResponseT>
Creates a ServerMethodDefinition that implements the specified unary RPC method by running the specified implementation and associated implementation details within a per-RPC CoroutineScope generated with the specified CoroutineContext.

Sources

jvm source
Link copied to clipboard