Closer

Collects resources and closes them cleanly in reversed order.

Since

0.0.1-alpha.1

See also

Functions

Link copied to clipboard
abstract suspend fun close()

Closes this resource.

Link copied to clipboard
abstract operator fun contains(closeable: SuspendCloseable): Boolean

Is closeable already remembered by this Closer?

Link copied to clipboard
operator fun Closer.plusAssign(autoCloseable: AutoCloseable)

Remember to close autoCloseable together with this closer.

operator fun Closer.plusAssign(suspendCloseable: SuspendCloseable)

Remember to close suspendCloseable together with this closer.

Link copied to clipboard
abstract operator fun <T : AutoCloseable> T.unaryPlus(): T

Remember to close this AutoCloseable together with this closer.

abstract operator fun <T : SuspendCloseable> T.unaryPlus(): T

Remember to close this SuspendCloseable together with this closer.