Package io.deephaven.base.pool
Interface Pool<T>
- All Known Subinterfaces:
LogBufferPool
,LogEntryPool
,Pool.MultiGiver<T>
,Pool.MultiPool<T>
,Pool.MultiTaker<T>
,Pool.SinglePool<T>
,PoolEx<T>
- All Known Implementing Classes:
DynamicDelayedLogEntryPoolImpl
,DynamicLogBufferPoolImpl
,DynamicLogEntryPoolImpl
,LogBufferPoolImpl
,LogEntryPoolImpl
,ThreadSafeFixedSizePool
,ThreadSafeFixedSizePool
,ThreadSafeLenientFixedSizePool
,ThreadSafeLenientFixedSizePool
public interface Pool<T>
Provides a pool of reusable items. Using a pool avoids garbage creation.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static interface
Must implement at least: Multiple threads may call give(), one thread may call take()static interface
Must implement at least: Multiple threads may call give(), multiple threads may call take()static interface
Must implement at least: Multiple threads may call take(), one thread may call give()static interface
Must implement at least: One thread may call give(), one thread may call take() -
Method Summary
-
Method Details
-
take
T take()Takes an item from the pool. Depending on pool policy, if there are no items available, this may block, create a new item, or throw aPoolEmptyException
. -
give
Gives an unused item back to the pool. Passingnull
is safe and has no effect. If the pool has a clearing procedure, the item will be cleared. Depending on pool policy, if the pool is full, this may block, discard the item, or throw aPoolFullException
.
-