en

Mark Murphy

Buku audio

Kutipan

b4777467766membuat kutipan2 tahun yang lalu
Similarly, coroutines are cooperative with respect to cancellation. It is entirely possible to create a coroutine that is oblivious to a cancellation request, but that is not a particularly good idea.
b4777467766membuat kutipan2 tahun yang lalu
yield() does two things:

Since it is a suspend function, it signals to the coroutines system that it is safe to switch to another coroutine from this dispatcher, if there is one around that is ready to run
It throws CancellationException if the job was canceled
b4777467766membuat kutipan2 tahun yang lalu
Another option for code with access to a CoroutineScope is to check the isActive property
fb2epub
Seret dan letakkan file Anda (maksimal 5 sekaligus)