Pool <T>
Hierarchy
- ArenaPool<T>
- Pool
Index
Constructors
Properties
Methods
Constructors
constructor
Type parameters
- T
Parameters
builder: () => T
optionalrecycler: (instance: T) => T
maxObjects: number = 100
Returns Pool<T>
Properties
publicinheritedbuilder
Type declaration
Returns T
publicinheriteddisableWarnings
publicinheritedindex
publicinheritedmaxObjects
publicinheritedobjects
publicoptionalinheritedrecycler
Type declaration
Parameters
instance: T
Returns T
publicinheritedtotalAllocations
Methods
inheritedborrow
Use a single instance out of th pool and immediately return it to the pool
Parameters
context: (object: T) => void
Returns void
inheriteddispose
Returns void
inheriteddone
Signals we are done with the pool objects for now, Reclaims all objects in the pool.
If a list of pooled objects is passed to done they are un-hooked from the pool and are free to be passed to consumers
Parameters
rest...objects: T[]
A list of object to separate from the pool
Returns T[]
inheritedget
Retrieve a value from the pool, will allocate a new instance if necessary or recycle from the pool
Returns T
inheritedpreallocate
Returns void
inheritedusing
Use many instances out of the in the context and return all to the pool.
By returning values out of the context they will be un-hooked from the pool and are free to be passed to consumers
Parameters
context: (pool: ArenaPool<T>) => void | T[]
Returns T[]
Use ArenaPool