useThis

inline suspend fun <T : AsyncCloseable?, TR> T.useThis(block: T.() -> TR): TR

Executes the block with the AsyncCloseable as receiver, and closes the resource once done.