en

Mark Murphy

Sesli kitaplar

Alıntılar

b4777467766alıntı yaptı2 yıl önce
So, for example, a repository could wrap its Room DAO write calls in a NonCancellable coroutine:
b4777467766alıntı yaptı2 yıl önce
The downside is that the coroutine cannot be canceled at all, and the code in that coroutine might assume that it can be cancelled normally.
b4777467766alıntı yaptı2 yıl önce
Another approach is to switch to a different CoroutineScope, one that will not be canceled by the user navigating away from our UI. For example, you could use GlobalScope… but we do not have a lot of control over the behavior of GlobalScope.

But, we can create our own CoroutineScope easily enough
fb2epub
Dosyalarınızı sürükleyin ve bırakın (bir kerede en fazla 5 tane)