Hi! Is it possible to run inside coroutine some bl...
# coroutines
p
Hi! Is it possible to run inside coroutine some block of code that will not be cancelled if coroutine is cancelled? There is a need to make some kind of resource cleaning at the finally block that is also suspendable. It must be done in the same function without launching it in other scope (finally block finished only after cleaning code is finished).
j
You can use
withContext(NonCancellable) { ... }
(see doc)
p
Thanks, Joffrey! Is it multiplatform?
j
To my knowledge, yes