This message was deleted.
# coroutines
s
This message was deleted.
t
By "computational operations", the docs states "any blocking operation that can take some time to complete", for example disc/network IO, scientific computation, data filtering, etc. In order to write suspend functions that are cancellable, you have to : - call other suspend functions that support cancellation (it is often indicated in their documentation) - check that the coroutine is still active, and either throw
CancellationException
(
ensureActive()
) or make the block complete early (just like with
Thread
cancellation).
d
You can start a coroutine atomically or with
NonCancellable
context to make it not cancel by cancellation in the middle of the coroutine. I think.