DisposableGroup

interface DisposableGroup : DisposableHandle

A Disposable that can dispose multiple Disposable and Job instances at once.

On dispose this destroys all Disposable and Job instances attached to it.

Inheritors

Properties

Link copied to clipboard
abstract val size: Int

Functions

Link copied to clipboard
abstract fun add(disposable: Disposable)

Add a Disposable to this group.

abstract fun add(job: Job)

Add a Job to this group.

Link copied to clipboard
abstract 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).

Link copied to clipboard
abstract fun remove(disposable: Disposable)

Remove a Disposable from this group.

abstract fun remove(job: Job)

Remove a Job from this group.