registerService

fun <Service : Any> registerService(serviceKClass: KClass<Service>, serviceFactory: () -> Service)(source)

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 does not specify the actual retention policy.

Parameters

serviceKClass

KClass of the Service.

serviceFactory

function that produces the actual implementation of the service that will handle the calls.

Type Parameters

Service

the exact type of the server to be registered. For example, for service with MyService interface and MyServiceImpl implementation, type MyService should be specified explicitly.


inline fun <Service : Any> registerService(noinline serviceFactory: () -> Service)(source)

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 does not specify the actual retention policy.

Parameters

serviceFactory

function that produces the actual implementation of the service that will handle the calls.

Type Parameters

Service

the exact type of the server to be registered. For example, for service with MyService interface and MyServiceImpl implementation, type MyService should be specified explicitly.