Optional
Readonly
capacity?: numberMaximum number of resources for this pool
Optional
Readonly
capacityPerResource?: numberMaximum number of users per resource. Defaults to 1
Optional
Readonly
debug?: booleanIf true, additional logging will trace activity of pool. Default: false
Optional
Readonly
free?: (v: V) => voidIf specified, this function will be called when a resource is disposed
Optional
Readonly
fullPolicy?: FullPolicyWhat to do if pool is full and a new resource allocation is requested.
Default is error
, throwing an error when pool is full.
Optional
Readonly
generate?: () => VIf specified, this function will generate new resources as needed.
Optional
Readonly
resourcesWithoutUserExpireAfterMs?: numberIf above 0, resources with no users will be automatically removed after this interval. Default: disabled
Optional
Readonly
userExpireAfterMs?: numberIf above 0, users will be removed if there is no activity after this interval.
Activity is marked whenever use
us called with that user key.
Default: disabled
Pool options