Package io.ktor.utils.io.pool

Types

ByteBufferPool
Link copied to clipboard
class ByteBufferPool(capacity: Int, bufferSize: Int) : DefaultPool<ByteBuffer>
DefaultPool
Link copied to clipboard
common
abstract class DefaultPool<T : Any>(capacity: Int) : ObjectPool<T>
Default object pool implementation.
abstract class DefaultPool<T : Any>(capacity: Int) : ObjectPool<T>
abstract class DefaultPool<T : Any>(capacity: Int) : ObjectPool<T>
DirectByteBufferPool
Link copied to clipboard
class DirectByteBufferPool(capacity: Int, bufferSize: Int) : DefaultPool<ByteBuffer>
NoPoolImpl
Link copied to clipboard
common
abstract class NoPoolImpl<T : Any> : ObjectPool<T>
A pool implementation of zero capacity that always creates new instances
ObjectPool
Link copied to clipboard
common
interface ObjectPool<T : Any> : Closeable
SingleInstancePool
Link copied to clipboard
common
abstract class SingleInstancePool<T : Any> : ObjectPool<T>
A pool that produces at most one instance

Functions

useBorrowed
Link copied to clipboard
common
inline fun <T : Any, R> ObjectPool<T>.useBorrowed(block: (T) -> R): R
Borrows and instance of T from the pool, invokes block with it and finally recycles it
useInstance
Link copied to clipboard
common
inline fun <T : Any, R> ObjectPool<T>.useInstance(block: (T) -> R): R
Borrows and instance of T from the pool, invokes block with it and finally recycles it

Properties

ByteArrayPool
Link copied to clipboard
common
val ByteArrayPool: ObjectPool<ByteArray>