cancel

abstract fun cancel(reason: String = "Cancelled by user")(source)

Requests cooperative cancellation. The public lifecycle resolves immediately with a Cancelled result and FitCancelled event as soon as this handle wins the terminal state; the worker is then cancelled. Calling cancel more than once or after the fit has already ended is safe and has no effect.