diff --git a/src/commonMain/kotlin/eu/vendeli/rethis/ReThis.kt b/src/commonMain/kotlin/eu/vendeli/rethis/ReThis.kt index 0a21c62f..6d83da7a 100644 --- a/src/commonMain/kotlin/eu/vendeli/rethis/ReThis.kt +++ b/src/commonMain/kotlin/eu/vendeli/rethis/ReThis.kt @@ -33,8 +33,12 @@ class ReThis( val logger = KtorSimpleLogger("eu.vendeli.rethis.ReThis") internal val cfg: ClientConfiguration = ClientConfiguration().apply(configurator) internal val rootJob = SupervisorJob() + internal val subscriptionHandlers = mutableMapOf() + internal val connectionPool by lazy { ConnectionPool(this, address.socket).also { it.prepare() } } init { + logger.info("Created client (RESP $protocol)") + if (address is Url) { cfg.db = address.db if (address.credentials.isNotEmpty()) { @@ -46,13 +50,6 @@ class ReThis( } } - internal val subscriptionHandlers = mutableMapOf() - internal val connectionPool by lazy { ConnectionPool(this, address.socket).also { it.prepare() } } - - init { - logger.info("Created client (RESP $protocol)") - } - val subscriptions: Map get() = subscriptionHandlers val isDisconnected: Boolean get() = connectionPool.isEmpty