All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.kotlinw.util.coroutine.SuspendingCloseable.kt Maven / Gradle / Ivy

package kotlinw.util.coroutine

interface SuspendingCloseable {

    suspend fun close()
}

suspend inline fun  C.use(block: (C) -> T) =
    try {
        block(this)
    } finally {
        runCatching { close() }
    }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy