Config<A, E>Normalized configuration used by a Pool.
When to use
Use as the normalized, read-only description of how a pool acquires, sizes, shares, and resizes its items after construction.
Details
The config stores the acquire effect, size bounds, per-item concurrency, target utilization, and resizing strategy used by the pool implementation.
export interface interface Config<A, E>Normalized configuration used by a Pool.
When to use
Use as the normalized, read-only description of how a pool acquires, sizes,
shares, and resizes its items after construction.
Details
The config stores the acquire effect, size bounds, per-item concurrency,
target utilization, and resizing strategy used by the pool implementation.
Config<function (type parameter) A in Config<A, E>A, function (type parameter) E in Config<A, E>E> {
readonly Config<A, E>.acquire: Effect.Effect<A, E, Scope.Scope>(property) Config<A, E>.acquire: {
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
acquire: import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<function (type parameter) A in Config<A, E>A, function (type parameter) E in Config<A, E>E, import ScopeScope.Scope>
readonly Config<A, E>.concurrency: numberconcurrency: number
readonly Config<A, E>.minSize: numberminSize: number
readonly Config<A, E>.maxSize: numbermaxSize: number
readonly Config<A, E>.strategy: Strategy<A, E>(property) Config<A, E>.strategy: {
run: (pool: Pool<A, E>) => Effect.Effect<void>;
onAcquire: (item: PoolItem<A, E>) => Effect.Effect<void>;
reclaim: (pool: Pool<A, E>) => Effect.Effect<PoolItem<A, E> | undefined>;
}
strategy: interface Strategy<A, E>Strategy used by a Pool to manage background resizing and item
reclamation.
When to use
Use when defining a custom pool lifecycle policy that needs to run background
work, observe acquired items, or choose items for reclamation.
Details
run starts any strategy-specific background work, onAcquire is invoked
when an item is acquired, and reclaim selects an item that can be removed
or replaced.
Strategy<function (type parameter) A in Config<A, E>A, function (type parameter) E in Config<A, E>E>
readonly Config<A, E>.targetUtilization: numbertargetUtilization: number
}