Repository navigation
refactor(pools): share dynamic pool lifecycle - #268
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Lift the dynamic pool lifecycle from thread/dynamic.ts and thread/fixed.ts into AbstractPool: a supportsDynamicWorkers getter gates the private dynamic pool state that tracks empty/full transitions, capacity predicates move to pools/utils, and back pressure, busy and growth decisions become concrete pool members. Fixed pools keep fixed semantics; dynamic pools only override supportsDynamicWorkers. Port of poolifier/poolifier#3455.
jerome-benoit
force-pushed
the
port-dynamic-lifecycle
branch
from
December 2, 2026 00:24
acd3061 to
310e388
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What / Why
Port of poolifier/poolifier#3455 (
refactor(pool): share dynamic pool lifecycle, final head15905bb36).thread/dynamic.tsandthread/fixed.tsintoAbstractPool.supportsDynamicWorkersprotected getter (defaultfalse);DynamicThreadPooloverrides it totrue.#dynamicPoolState(emptyEventEmitted/fullEventEmitted) initialized in theAbstractPoolconstructor beforeisMain();DynamicPoolStateinterface moves topools/pool.ts.backPressure,busyandshallCreateDynamicWorkerbecome concreteAbstractPoolmembers using the capacity predicatesisDynamicPoolEmpty/isDynamicPoolFullfrompools/utils.ts; the prototype/constructor marker machinery is gone.thread/dynamic.tsdid.Adaptations to this repo
it.eachrows for cluster are omitted; thread rows only.pool.info.backPressureis only exposed whenenableTasksQueueis enabled in this repo; the construction test asserts thebackPressure/busygetters directly, and post-constructioninfoassertions use the fields this repo exposes (maxSize,started).destroy()throws on a non-started pool here; the construction test guards the call withpool.info.started.#privatefields: native#field brands are not installed beforesuper()completes in.mjs, which would throw during construction.Verification
deno fmt --checkanddeno lint: clean.deno check src/mod.ts: clean.deno test -A tests/: 571 steps pass, 0 failed, 9 ignored (master baseline).PR Checklist