Skip to content

Commit

Permalink
lib: settle signals when abortcontroller is GCed
Browse files Browse the repository at this point in the history
  • Loading branch information
geeksilva97 committed Nov 12, 2024
1 parent 03d414e commit 8b710b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/internal/abort_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ function lazyMessageChannel() {
}

const clearTimeoutRegistry = new SafeFinalizationRegistry(clearTimeout);
const abortControllerSignalFinalizer = new SafeFinalizationRegistry(({ dependantSignals }) => {
// WIP on https://docs.google.com/document/d/1LvmsBLV85p-PhSGvTH-YwgD6onuhh1VXLg8jPlH32H4/edit?pli=1&tab=t.0#heading=h.7ut6obnf9fz0
// Remove ac.signal from composed signals
// If not source signal remains in the composed signal, let it be GCed
});

const dependantSignalsCleanupRegistry = new SafeFinalizationRegistry((signalWeakRef) => {
const signal = signalWeakRef.deref();
if (signal === undefined) {
Expand Down

0 comments on commit 8b710b2

Please sign in to comment.