public interface Allocator<T extends reactor.core.support.Recyclable>
Allocator is responsible for returning to the caller a Reference to a reusable
object or to provide a newly-created object, depending on the underlying allocation strategy.| Modifier and Type | Method and Description |
|---|---|
Reference<T> |
allocate()
Allocate an object from the internal pool.
|
java.util.List<Reference<T>> |
allocateBatch(int size)
Allocate a batch of objects all at once.
|
void |
release(java.util.List<Reference<T>> batch)
Efficiently release a batch of References all at once.
|
Reference<T> allocate()
Reference that can be retained and released.java.util.List<Reference<T>> allocateBatch(int size)
size - the number of objects to allocateList of References to the allocated objects