toggle menu
river
common
switch theme
search in API
core
/
com.river.core
/
ObjectPool
Object
Pool
interface
ObjectPool
<
T
>
Members
Types
Object
Holder
Link copied to clipboard
class
ObjectHolder
<
T
>
(
val
instance
:
T
,
val
maxDuration
:
Duration
,
val
createdAt
:
Instant
=
Clock.System.now()
)
Functions
borrow
Link copied to clipboard
abstract
suspend
fun
borrow
(
)
:
ObjectPool.ObjectHolder
<
T
>
open
suspend
fun
<
R
>
borrow
(
f
:
suspend
(
T
)
->
R
)
:
R
close
Link copied to clipboard
abstract
suspend
fun
close
(
)
release
Link copied to clipboard
abstract
suspend
fun
release
(
holder
:
ObjectPool.ObjectHolder
<
T
>
)