registerService
abstract fun <Service : Any> registerService(serviceKClass: KClass<Service>, serviceFactory: () -> Service)(source)
Registers new service. 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.
Parameters
Service
the exact type of the server to be registered. For example, for a service with MyService
interface and MyServiceImpl
implementation the type MyService
should be specified explicitly.
serviceFactory
function that produces the actual implementation of the service that will handle the calls.