ObjectPool

p5ex~ ObjectPool

Object pool which calls the provided function for every element when using & recyling. Intended to use with the library deePool, but can also be used with another implementation.

Constructor

new ObjectPool(naivePool, useProcess, recycleProcess)

Source:
Parameters:
Name Type Description
naivePool The pool object with use() and recycle(obj) methods.
useProcess The callback function which will be called in use().
recycleProcess The callback function which will be called in recycle().

Methods

recycleAll(array)

Recycles all elements of the provided array.
Source:
Parameters:
Name Type Description
array

use()

Returns an object which is currently not in use.
Source: