There must be some point in your calculation that you can check this, like in looping...
m
misko
01/15/2018, 7:30 PM
Generally it could be very unsafe to just cancel some work, without cooperation of the worker. Java future (old version) has this, though thread doing work can defend against it (uninterruptable). Newer completableFuture, opt out of cancellation completely, when you call cancel on a completable future it does NOTHING to the currently working thread, just cancels the future. So I am happy with getting any support for cancellations in coroutines, I think it is done elegantly