Tolriq
11/28/2018, 11:16 AMelizarov
11/28/2018, 11:18 AMGlobalScope
better describes intent here (of a separate non-scoped background process)GlobalScope.launch { ... }
and launch { ... withContext(NonCancellable) { ... } .. }
is that the latter also inherits dispatcher, which if likely not something you want in this case.dbScope
and consistently use it for such tasks to be clear. It could be something like val dbScope = GlobalScope + <http://Dispatchers.IO|Dispatchers.IO>
Tolriq
11/28/2018, 11:23 AM