Running an async task with a timeout

I would not recommend checking cancellation AFTER the work was already completed. It's a bit of a waste of computation -- cancellation is useful to avoid un-necessary work. But if the work was already done... there's not much reason to discard the result.

If someone wanted to discard the result they can do so on the calling function still.

1 Like