commonMain.com.caesarealabs.rpc4k.runtime.user.ClientUsage.kt Maven / Gradle / Ivy
package com.caesarealabs.rpc4k.runtime.user
import com.caesarealabs.rpc4k.runtime.api.RpcClientFactory
import com.caesarealabs.rpc4k.runtime.api.SerializationFormat
import com.caesarealabs.rpc4k.runtime.api.components.JsonFormat
public fun Rpc4kIndex.client(
url: String,
// TODO: MPP default
client: RpcClientFactory /*= RpcClientFactory.OkHttp()*/,
format: SerializationFormat = JsonFormat(),
x: Int = 2
): C {
val websocketUrl = "$url/events"
val clientSetup = client.build(url, websocketUrl)
return createNetworkClient(clientSetup, format)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy