Package-level declarations

Types

Link copied to clipboard
interface RemoteService

Marker interface for an RPC service.

Link copied to clipboard
class RpcCall(val descriptor: RpcServiceDescriptor<*>, val callableName: String, val parameters: Array<Any?>, val serviceId: Long)

Represents a method call from an RPC service.

Link copied to clipboard
interface RpcClient

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.

Link copied to clipboard
interface RpcServer

RpcServer is used to accept RPC messages, route them to a specific service, and process given responses. Server may contain multiple services.

Functions

Link copied to clipboard
inline fun <Service : Any> RpcServer.registerService(noinline serviceFactory: () -> Service)

Registers new service to the server. Server will route all designated messages to it. Service of any type should be unique on the server, but RpcServer doesn't specify the actual retention policy.

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.