FailoverRegistry

Registry for managing multiple named Failover chains.

Example usage:

val registry = FailoverRegistry.create()

val transport = registry.getOrCreate<Connection>("realtime-transport") {
provider("websocket") { connectWebSocket() }
provider("mqtt") { connectMqtt() }
}

Types

Link copied to clipboard
object Companion

Factory for FailoverRegistry.

Functions

Link copied to clipboard
suspend fun <T> get(name: String): Failover<T>?

Gets an existing failover chain by name.

Link copied to clipboard
suspend fun getNames(): Set<String>

Gets all failover chain names in the registry.

Link copied to clipboard
suspend fun <T> getOrCreate(name: String, configure: suspend FailoverBuilder<T>.() -> Unit): Failover<T>

Gets an existing failover chain or builds a new one from configure.

Link copied to clipboard
suspend fun remove(name: String): Failover<*>?

Removes a failover chain from the registry.