Package-level declarations

Types

Link copied to clipboard
class ByteBufferPool(capacity: Int = DEFAULT_POOL_CAPACITY, val bufferSize: Int = DEFAULT_BUFFER_SIZE) : 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>(val capacity: Int) : ObjectPool<T>
actual abstract class DefaultPool<T : Any>(val capacity: Int)
actual abstract class DefaultPool<T : Any>(val capacity: Int) : ObjectPool<T>
Link copied to clipboard
class DirectByteBufferPool(capacity: Int = DEFAULT_POOL_CAPACITY, val bufferSize: Int = DEFAULT_BUFFER_SIZE) : 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

Properties

Link copied to clipboard

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