Explicitly switch between IO/UI dispatchers when updating list of extensions

Potentially fixes #2566
This commit is contained in:
arkon
2020-02-03 19:11:18 -05:00
parent 09891bb0ad
commit 7af075633b
2 changed files with 11 additions and 2 deletions
@@ -5,6 +5,9 @@ import kotlinx.coroutines.*
fun launchUI(block: suspend CoroutineScope.() -> Unit): Job =
GlobalScope.launch(Dispatchers.Main, CoroutineStart.DEFAULT, block)
fun launchIO(block: suspend CoroutineScope.() -> Unit): Job =
GlobalScope.launch(Dispatchers.IO, CoroutineStart.DEFAULT, block)
@UseExperimental(ExperimentalCoroutinesApi::class)
fun launchNow(block: suspend CoroutineScope.() -> Unit): Job =
GlobalScope.launch(Dispatchers.Main, CoroutineStart.UNDISPATCHED, block)