https://kotlinlang.org logo
#coroutines
Title
# coroutines
f

fitermay

07/27/2022, 8:32 PM
That is what if the cancellation happens when return is invoked
j

Joffrey

07/27/2022, 9:29 PM
As I mentioned in the previous message, cancellation is cooperative and cannot happen during a return. But cancellation could happen during a suspend function call that is made in the
return
argument, such as
return mySuspendFun()
. What I said in the previous message still holds: use a `try`/`finally` block
2 Views