AbortSignal

interface AbortSignal(source)

Since

0.3.0-beta01

Types

Link copied to clipboard

Properties

Link copied to clipboard
abstract val isAborted: Boolean

True once any cancellation source has fired.

Functions

Link copied to clipboard
abstract fun register(onAbort: () -> Unit): AbortSignal.AbortRegistration

Register a callback that fires exactly once on abort. If already aborted, fires synchronously. Returns a handle to deregister.

Link copied to clipboard
abstract fun throwIfAborted()

Throws AbortError if isAborted. Cheap to call repeatedly.