RpcClient

interface RpcClient(source)

RpcClient represents an abstraction of an RPC client, that can handle requests from several RPC services, transform them, send to the server and handle responses and errors.

Functions

Link copied to clipboard
abstract suspend fun <T> call(call: RpcCall): T

This method is used by generated clients to perform a call to the server.

Link copied to clipboard
abstract fun <T> callServerStreaming(call: RpcCall): Flow<T>

This method is used by generated clients to perform a call to the server that returns a streaming flow.

Link copied to clipboard
inline fun <T : Any> RpcClient.withService(): T
fun <T : Any> RpcClient.withService(serviceKClass: KClass<T>): T
fun <T : Any> RpcClient.withService(serviceKType: KType): T

Creates an instance of the generated service T, that is able to communicate with a server using this RpcClient.