mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
14 lines
312 B
Kotlin
14 lines
312 B
Kotlin
package com.github.libretube.extensions
|
|
|
|
import kotlinx.coroutines.CoroutineScope
|
|
import kotlinx.coroutines.Dispatchers
|
|
import kotlinx.coroutines.launch
|
|
|
|
fun runCatchingIO(block: suspend () -> Unit) {
|
|
CoroutineScope(Dispatchers.IO).launch {
|
|
runCatching {
|
|
block.invoke()
|
|
}
|
|
}
|
|
}
|