EntityPoolOptions
Defined in: EntityPool.ts:30
Pool behaviour. TMax carries whether the pool is capped into acquire’s return type.
Type Parameters
Section titled “Type Parameters”T extends PoolableEntity
TMax extends number | undefined = undefined
Properties
Section titled “Properties”maxSize?
Section titled “maxSize?”
optionalmaxSize?:TMax
Defined in: EntityPool.ts:46
Upper bound on total members, leased and free together. Left out, the
pool is elastic: it grows whenever every member is out and acquire
always returns one. Set, a saturated acquire returns undefined and
only forceAcquire still produces a member, by reclaiming one.
prewarm?
Section titled “prewarm?”
optionalprewarm?:number
Defined in: EntityPool.ts:39
Members to construct up front, parked dormant. They run their
constructor and setup(), never onAcquire — prewarming is not an
acquisition.
reclaimPriority?
Section titled “reclaimPriority?”
optionalreclaimPriority?: (member) =>number
Defined in: EntityPool.ts:52
Victim selection for forceAcquire on a saturated pool: the leased
member with the lowest value is taken, ties going to the one acquired
longest ago. Default: oldest acquired.
Parameters
Section titled “Parameters”member
Section titled “member”T
Returns
Section titled “Returns”number