class CancellableContinuation
source · line 4public
public class CancellableContinuation<T> internal constructor(continuation: Continuation<T>)
Arbitrates result delivery and cancellation so only one terminal outcome wins.
function invokeOnCancellation
source · line 91public
public fun invokeOnCancellation(handler: (CancellationException) -> Unit): Disposable
Registers cancellation cleanup and returns a disposable registration. An already-cancelled continuation invokes the handler immediately.
parameter handler
source · line 91public
handler: (CancellationException) -> Unit
function tryResume
source · line 48public
public fun tryResume(value: T): Boolean
Offers a result and returns false when another completion or cancellation already won.
parameter value
source · line 48public
value: T
type parameter T
source · line 4public
T
function tryResumeWithException
source · line 62public
public fun tryResumeWithException(exception: Throwable): Boolean
Offers an exception and returns false when the continuation has already been claimed.
parameter exception
source · line 62public
exception: Throwable