nativeDarwin.io.realm.kotlin.mongodb.internal.HttpClientCache.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of library-sync Show documentation
Show all versions of library-sync Show documentation
Sync Library code for Realm Kotlin. This artifact is not supposed to be consumed directly, but through 'io.realm.kotlin:gradle-plugin:1.6.2' instead.
package io.realm.kotlin.mongodb.internal
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.engine.darwin.Darwin
import io.ktor.client.plugins.logging.Logger
/**
* Cache HttpClient on iOS.
*/
internal actual class HttpClientCache actual constructor(timeoutMs: Long, customLogger: Logger?) {
private val client: HttpClient by lazy { createClient(timeoutMs, customLogger) }
actual fun getClient(): HttpClient {
return client
}
actual fun close() {
client.close()
}
}
public actual fun createPlatformClient(block: HttpClientConfig<*>.() -> Unit): HttpClient {
return HttpClient(Darwin, block)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy