Skip to content

Interface: PoolCandidateState<TItem> ​

Defined in: ast/pool-candidate-state.ts:9

Runtime telemetry and rate-limit state for a single candidate item inside a capacity pool.

Provided to custom PoolSelectorFn callbacks so selection strategies can inspect empirical completion rates, usage counts, and rate-limit cooldown timestamps.

Type Parameters ​

Type ParameterDefault typeDescription
TItemunknownPooled resource item type (such as AccountSeatASTNode or ModelASTNode).

Properties ​

PropertyModifierTypeDescriptionDefined in
empiricalSuccessRatereadonlynumberRatio successCount / sampleCount in [0, 1] (or 1 when sampleCount === 0).ast/pool-candidate-state.ts:27
idreadonlystringLogical identifier or alias of the candidate item.ast/pool-candidate-state.ts:15
indexreadonlynumberZero-based declaration index of the candidate inside PoolNode.items.ast/pool-candidate-state.ts:13
itemreadonlyTItemUnderlying AST node for the pooled candidate item.ast/pool-candidate-state.ts:11
lastUsedAtMs?readonlynumberEpoch timestamp in milliseconds when this candidate was most recently acquired.ast/pool-candidate-state.ts:21
rateLimitedUntilMs?readonlynumberEpoch timestamp in milliseconds until which this candidate is rate-limited, if applicable.ast/pool-candidate-state.ts:17
sampleCountreadonlynumberCumulative number of total attempts recorded for this candidate.ast/pool-candidate-state.ts:25
successCountreadonlynumberCumulative number of successful completions recorded for this candidate.ast/pool-candidate-state.ts:23
usageCountreadonlynumberTotal number of acquisitions served by this candidate in the current runtime.ast/pool-candidate-state.ts:19

Released under the MIT License.