Object containing factory methods for io.github.andrebeat.pool.Pool.
Attributes
Members list
Type members
Classlikes
An exception that is thrown when trying to use a closed pool.
An exception that is thrown when trying to use a closed pool.
Attributes
- Supertypes
-
class Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Value members
Concrete methods
Creates a new io.github.andrebeat.pool.ExpiringPool or io.github.andrebeat.pool.SimplePool instance depending on whether a non-zero and finite maxIdleTime
is set or not.
Creates a new io.github.andrebeat.pool.ExpiringPool or io.github.andrebeat.pool.SimplePool instance depending on whether a non-zero and finite maxIdleTime
is set or not.
Value parameters
- capacity
-
the maximum capacity of the pool
- dispose
-
the function used to destroy an object from the pool
- factory
-
the function used to create new objects in the pool
- healthCheck
-
the predicate used to test whether an object is healthy and should be used, or destroyed otherwise.
- maxIdleTime
-
the maximum amount of the time that objects are allowed to idle in the pool before being evicted
- referenceType
-
the reference type of objects in the io.github.andrebeat.pool.Pool. io.github.andrebeat.pool.ReferenceType.Soft and io.github.andrebeat.pool.ReferenceType.Weak reference are eligible for collection by the GC
- reset
-
the function used to reset objects in the pool (called when leasing an object from the pool)
Attributes
- Returns
-
a new instance of io.github.andrebeat.pool.Pool.