ObjectPool

interface ObjectPool<T>

Types

Link copied to clipboard
class ObjectHolder<T>(val instance: T, val maxDuration: Duration, val createdAt: Instant = Clock.System.now())

Functions

Link copied to clipboard
abstract suspend fun borrow(): ObjectPool.ObjectHolder<T>
open suspend fun <R> borrow(f: suspend (T) -> R): R
Link copied to clipboard
abstract suspend fun close()
Link copied to clipboard
abstract suspend fun release(holder: ObjectPool.ObjectHolder<T>)