Home

# Class goog.structs.PriorityPool

A generic pool class. If max is greater than min, an error is thrown.

extends goog.structs.Pool

Instance Method Summary
| `addFreeObject(?Object obj)` Adds an object to the collection of objects that are free. If the object can not be added, then it is disposed. NOTE: This method does not remove the object from the in use collection.
| `adjustForMinMax()` Adjusts the objects held in the pool to be within the min/max constraints. NOTE: It is possible that the number of objects in the pool will still be greater than the maximum count of objects allowed. This will be the case if no more free objects can be disposed of to get below the minimum count (i.e., all objects are in use).
| `disposeInternal()` Disposes of the pool and all objects currently held in the pool.
| `getObject(?Function= opt_callback, <Any Type> opt_priority) ⇒ (Object|null|undefined)` Get a new object from the the pool, if there is one available, otherwise return undefined.
| `handleQueueRequests_()` Handles the request queue. Tries to fires off as many queued requests as possible.
| `setDelay(number delay)` Sets the minimum delay between objects being returned by getObject, in milliseconds. This defaults to zero, meaning that no minimum delay is enforced and objects may be used as soon as they're available.