Package io.ktor.utils.io.pool

Types

Link copied to clipboard
class ByteBufferPool(capacity: Int, bufferSize: Int) : DefaultPool<ByteBuffer>
Link copied to clipboard
expect abstract class DefaultPool<T : Any>(capacity: Int) : ObjectPool<T>

Default object pool implementation.

actual abstract class DefaultPool<T : Any>(capacity: Int) : ObjectPool<T>
actual abstract class DefaultPool<T : Any>(capacity: Int) : ObjectPool<T>
actual abstract class DefaultPool<T : Any>(capacity: Int) : ObjectPool<T>
Link copied to clipboard
class DirectByteBufferPool(capacity: Int, bufferSize: Int) : DefaultPool<ByteBuffer>
Link copied to clipboard
abstract class NoPoolImpl<T : Any> : ObjectPool<T>

A pool implementation of zero capacity that always creates new instances

Link copied to clipboard
interface ObjectPool<T : Any> : Closeable
Link copied to clipboard
abstract class SingleInstancePool<T : Any> : ObjectPool<T>

A pool that produces at most one instance

Functions

Link copied to clipboard
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

Link copied to clipboard
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

Link copied to clipboard
val ByteArrayPool: ObjectPool<ByteArray>