Skip to content

Track active loaders and promise adapters - #12

Closed
simPod wants to merge 2 commits into
masterfrom
fix/promise-adapter-selection
Closed

Track active loaders and promise adapters#12
simPod wants to merge 2 commits into
masterfrom
fix/promise-adapter-selection

Conversation

@simPod

@simPod simPod commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Retain loaders strongly only while they have queued work.
  • Track live loaders and promise ownership with weak maps.
  • Select the adapter that owns or recognizes an awaited promise.
  • Prevent loader destruction from dispatching unrelated work.
  • Record the lifecycle decision in an ADR.

Motivation

The global strong registry retained every loader and cache. Static await also selected the first registered adapter, which is incorrect when an application uses multiple promise libraries.

@simPod
simPod force-pushed the fix/promise-adapter-selection branch 3 times, most recently from 2fac2bc to 58a17b1 Compare August 18, 2026 07:05
simPod added 2 commits August 18, 2026 09:14
Context: A strong global registry retains idle loaders and can select the wrong adapter.\n\nDecision: Retain only queued loaders and weakly map load promises to their adapters.\n\nConsequences: Idle loaders are collectible while queued work remains live until dispatch.
@simPod
simPod force-pushed the fix/promise-adapter-selection branch from 58a17b1 to 872c41f Compare August 18, 2026 07:24
@simPod simPod closed this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant