A constructor specific object pool implementation for asynchronous recycling of object allocations.
npm install object-pool-2 --save
Creates a new object pool. Accepts an
Constructor which will be used internally in order to instantiate new
Constructor instances (via
Asynchronous. Allocates a new
Constructor instance. This either results into a new instance being created or a previously deallocated instance being reused.
Deallocates a allocated
Constructor instance. This enables the object to be reused if needed.
Maximum number of internally managed
Constructor instances. Defaults to 10. Will throw an error if
Read-only. Number of available, but not necessarily allocated,
Read-only. Number of internally managed allocated (therefore not de-allocated)