Implements an com.github.mauricio.async.db.pool.AsyncObjectPool using a single thread from a fixed executor service as an event loop to cause all calls to be sequential.
Once you are done with this object remember to call it's close method to clean up the thread pool and it's objects as this might prevent your application from ending.
- Type Params
- T
type of the object this pool holds
- Companion
- object
Value members
Concrete methods
Returns an object to the pool. The object is validated before being added to the collection of available objects to make sure we have a usable object. If the object isn't valid it's discarded.
Returns an object to the pool. The object is validated before being added to the collection of available objects to make sure we have a usable object. If the object isn't valid it's discarded.
Inherited methods
Retrieve and use an object from the pool for a single computation, returning it when the operation completes.
Retrieve and use an object from the pool for a single computation, returning it when the operation completes.
- Value Params
- f
function that uses the object
- Returns
f wrapped with take and giveBack
- Inherited from
- AsyncObjectPool