@@ -13,20 +13,32 @@ import kotlin.reflect.KClass
13
13
*/
14
14
public interface RpcServer {
15
15
/* *
16
- * Registers new service to the server . Server will route all designated messages to it.
16
+ * Registers new service. Server will route all designated messages to it.
17
17
* Service of any type should be unique on the server, but RpcServer doesn't specify the actual retention policy.
18
18
*
19
19
* @param Service the exact type of the server to be registered.
20
- * For example, for service with `MyService` interface and `MyServiceImpl` implementation,
21
- * type `MyService` should be specified explicitly.
20
+ * For example, for a service with `MyService` interface and `MyServiceImpl` implementation
21
+ * the type `MyService` should be specified explicitly.
22
22
* @param serviceKClass [KClass] of the [Service].
23
23
* @param serviceFactory function that produces the actual implementation of the service that will handle the calls.
24
+ *
25
+ * @see kotlinx.rpc.annotations.CheckedTypeAnnotation
24
26
*/
25
27
public fun <@Rpc Service : Any > registerService (
26
28
serviceKClass : KClass <Service >,
27
29
serviceFactory : () -> Service ,
28
30
)
29
31
32
+ /* *
33
+ * Deregisters a service. Server will stop routing messages to it.
34
+ *
35
+ * @param Service the exact type of the server to be deregistered, the same one that was used for registration.
36
+ * For example, for a service with `MyService` interface and `MyServiceImpl` implementation
37
+ * the type `MyService` should be specified explicitly.
38
+ * @param serviceKClass [KClass] of the [Service].
39
+ *
40
+ * @see kotlinx.rpc.annotations.CheckedTypeAnnotation
41
+ */
30
42
public fun <@Rpc Service : Any > deregisterService (
31
43
serviceKClass : KClass <Service >,
32
44
)
@@ -37,9 +49,11 @@ public interface RpcServer {
37
49
* Service of any type should be unique on the server, but RpcServer doesn't specify the actual retention policy.
38
50
*
39
51
* @param Service the exact type of the server to be registered.
40
- * For example, for service with `MyService` interface and `MyServiceImpl` implementation,
41
- * type `MyService` should be specified explicitly.
52
+ * For example, for a service with `MyService` interface and `MyServiceImpl` implementation
53
+ * the type `MyService` should be specified explicitly.
42
54
* @param serviceFactory function that produces the actual implementation of the service that will handle the calls.
55
+ *
56
+ * @see kotlinx.rpc.annotations.CheckedTypeAnnotation
43
57
*/
44
58
public inline fun <@Rpc reified Service : Any > RpcServer.registerService (
45
59
noinline serviceFactory : () -> Service ,
0 commit comments