cancel

fun cancel(exception: Exception = CanceledException())

Attempts to cancel the open operation this object was passed to. This method has a default CanceledException parameter. Custom Exception classes can be used to signal the reason for canceling the operation.