There are two approaches: start coroutine with UI ...
# android
g
There are two approaches: start coroutine with UI context and do async ,(even blocking operatin) run coroutine in background thread and publish changes to UI (case of
bg
+
withContext(UI)
) Or you can run coroutine with UI dispatcher and use non blocking operations inside or run some child coroutines in thread pool. Just depends on you case, what is more convenient. But if all your calls are non blocking second option looks usually better, more clear code, no additional context switches