addCancelable

abstract fun addCancelable(action: suspend DeferrableScope.() -> Unit)

Adds a cancelable action to be executed upon completion.

The coroutine scope of the action will be cancelled when the completable is completed.

Deferred actions registered after the completable has already been completed will be executed.