DisposableValue

class DisposableValue<T>(val value: T, disposer: () -> Unit) : DisposableHandle

A value that must be explicitly disposed when it's not needed anymore.

Constructors

Link copied to clipboard
constructor(value: T, disposer: () -> Unit)

Properties

Link copied to clipboard
val value: T

Functions

Link copied to clipboard
open override fun dispose()
Link copied to clipboard

Disposes the Disposable when CoroutineLauncher completes (including cancellation).

Disposes the Disposable when CoroutineContext completes (including cancellation).

fun Disposable.disposeOnCompletionOf(scope: CoroutineScope): Disposable

Disposes the Disposable when CoroutineScope completes (including cancellation).

Disposes the Disposable when Job completes (including cancellation).