package com.rosetta.messenger.network.connection

class RuntimeShutdownCoordinator(
    private val stopWaitingForNetwork: (String) -> Unit,
    private val destroyPacketSubscriptionRegistry: () -> Unit,
    private val destroyProtocolInstance: () -> Unit,
    private val clearMessageRepositoryInitialization: () -> Unit,
    private val clearPresenceTyping: () -> Unit,
    private val clearDeviceRuntime: () -> Unit,
    private val resetSyncCoordinator: () -> Unit,
    private val resetAuthBootstrap: () -> Unit,
    private val cancelRuntimeScope: () -> Unit
) {
    fun destroy() {
        stopWaitingForNetwork("destroy")
        destroyPacketSubscriptionRegistry()
        destroyProtocolInstance()
        clearMessageRepositoryInitialization()
        clearPresenceTyping()
        clearDeviceRuntime()
        resetSyncCoordinator()
        resetAuthBootstrap()
        cancelRuntimeScope()
    }
}
