registerService

inline fun <Service : Any> RpcServer.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 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.

See also