Tasks are cooperative. Cancellation is just setting the isCancelled flag. It's your responsibility to handle the cancellation. You can check the flag and exit early, call checkCancellation() to throw an exception, add a cancellation handler, etc. But unless you do something specific to detect and respond to the cancellation, a cancelled task will just keep running as if nothing has changed.
Topic:
Programming Languages
SubTopic:
Swift
Tags: