Skip to content

Commit 25045d9

Browse files
authored
Make KtorRpcClient inherit KrpcClient (#396)
1 parent ce06a62 commit 25045d9

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

krpc/krpc-ktor/krpc-ktor-client/api/krpc-ktor-client.api

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ public final class kotlinx/rpc/krpc/ktor/client/KtorClientDslKt {
1313
public static synthetic fun rpcConfig$default (Lio/ktor/client/request/HttpRequestBuilder;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
1414
}
1515

16-
public abstract interface class kotlinx/rpc/krpc/ktor/client/KtorRpcClient : kotlinx/rpc/RpcClient {
16+
public abstract class kotlinx/rpc/krpc/ktor/client/KtorRpcClient : kotlinx/rpc/krpc/client/KrpcClient {
17+
public fun <init> ()V
1718
public abstract fun getWebSocketSession ()Lkotlinx/coroutines/Deferred;
1819
}
1920

krpc/krpc-ktor/krpc-ktor-client/api/krpc-ktor-client.klib.api

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
// - Show declarations: true
77

88
// Library unique name: <org.jetbrains.kotlinx:krpc-ktor-client>
9-
abstract interface kotlinx.rpc.krpc.ktor.client/KtorRpcClient : kotlinx.rpc/RpcClient { // kotlinx.rpc.krpc.ktor.client/KtorRpcClient|null[0]
9+
abstract class kotlinx.rpc.krpc.ktor.client/KtorRpcClient : kotlinx.rpc.krpc.client/KrpcClient { // kotlinx.rpc.krpc.ktor.client/KtorRpcClient|null[0]
10+
constructor <init>() // kotlinx.rpc.krpc.ktor.client/KtorRpcClient.<init>|<init>(){}[0]
11+
1012
abstract val webSocketSession // kotlinx.rpc.krpc.ktor.client/KtorRpcClient.webSocketSession|{}webSocketSession[0]
1113
abstract fun <get-webSocketSession>(): kotlinx.coroutines/Deferred<io.ktor.websocket/WebSocketSession> // kotlinx.rpc.krpc.ktor.client/KtorRpcClient.webSocketSession.<get-webSocketSession>|<get-webSocketSession>(){}[0]
1214
}

krpc/krpc-ktor/krpc-ktor-client/src/commonMain/kotlin/kotlinx/rpc/krpc/ktor/client/KtorRpcClient.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package kotlinx.rpc.krpc.ktor.client
@@ -22,19 +22,19 @@ import kotlinx.rpc.krpc.rpcClientConfig
2222
* Client is cold, meaning the connection will be established on the first request.
2323
* [webSocketSession] will be completed when the connection is established.
2424
*/
25-
public interface KtorRpcClient : RpcClient {
25+
public abstract class KtorRpcClient : KrpcClient() {
2626
/**
2727
* Cold [WebSocketSession] object. Instantiated when the connection is established on the first request.
2828
*/
29-
public val webSocketSession: Deferred<WebSocketSession>
29+
public abstract val webSocketSession: Deferred<WebSocketSession>
3030
}
3131

3232
internal class KtorKrpcClientImpl(
3333
private val pluginConfigBuilder: KrpcConfigBuilder.Client?,
3434
private val webSocketSessionFactory: suspend (
3535
configSetter: (KrpcConfigBuilder.Client.() -> Unit) -> Unit,
3636
) -> WebSocketSession,
37-
): KrpcClient(), KtorRpcClient {
37+
): KtorRpcClient() {
3838
private var requestConfigBuilder: KrpcConfigBuilder.Client.() -> Unit = {}
3939

4040
private val _webSocketSession = CompletableDeferred<WebSocketSession>()

0 commit comments

Comments
 (0)