cancelFutureOnCancellation
Cancels a specified future when this job is cancelled. This is a shortcut for the following code with slightly more efficient implementation (one fewer object created).
invokeOnCancellation { if (it != null) future.cancel(false) }
Content copied to clipboard