Skip to content

Commit 2933bc6

Browse files
committed
chore(types): regenerate declarations
1 parent a9e49d3 commit 2933bc6

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎types/src/lib/helpers/eventemitter-context.d.mts‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,19 @@ export function enableEventEmitterPatching(): void;
2121
*/
2222
export function disableEventEmitterPatching(): void;
2323
/**
24-
* Cleanup all tracked EventEmitters created within slothlet API context.
25-
* This removes all listeners from tracked emitters and clears tracking structures.
26-
* Should be called during shutdown to prevent memory leaks and hanging processes.
24+
* Release the EventEmitter state slothlet holds, when the last instance shuts down (#605).
25+
*
26+
* No listener is removed: an emitter a module created can outlive slothlet (undici keeps a `fetch`
27+
* socket in its keep-alive pool and later destroys it with an error), and the listeners on it belong to
28+
* the code that registered them. Every listener wrapper is released, so one firing later calls its
29+
* listener directly, with no instance context. On each tracked emitter, a wrapper registered with
30+
* `on` / `prependListener` is swapped in place for the function the code registered, and a `once` /
31+
* `prependOnceListener` wrapper for a plain one-shot wrapper with no slothlet state, which reports its
32+
* listener through `.listener` as Node's own does. The emitter then holds what it would without
33+
* slothlet. The swap edits the listener table directly, so no `removeListener` / `newListener` event
34+
* fires; a table the emitter keeps read-only is left as it is, its wrappers released. Every wrapper
35+
* drops its captured context (its AsyncResource and pinned caller) first, so one left on such a table
36+
* keeps no instance alive.
2737
*
2838
* @public
2939
*/

‎types/src/lib/helpers/eventemitter-context.d.mts.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)