Effects and fibers: make disposal finish
Synchronous registration needs undo; asynchronous work needs quiescence—both are required
register → disposer · start → stop → joinWhy does AbortController.abort() not mean a plugin has finished unloading?
Closing a shop is more than flipping the sign. Stop new orders, let the kitchen settle, inventory equipment, return keys, and confirm nobody remains inside.
Mechanism
Effects track synchronously reversible side effects such as services, listeners, and timers; context disposal unwinds their disposers by ownership.
Fibers own continuous or asynchronous work: request stop, then await done. Dependent worlds can unwind safely only after full quiescence.
Register effect
Each registration returns an owned disposer.
What extensions must preserve
- Requesting stop and confirming quiescence are distinct phases
- Dispose must be idempotent
- Consumers must stop before provider services are removed
The tempting wrong turns
- ×Fire-and-forget background promises
- ×Clearing an interval without awaiting the active tick
- ×Throwing in one disposer and preventing later cleanup
Do not trust the conclusion—verify it
These anchors are pinned to official deepseek-harness@47f9438; account for later breaking changes when reading current upstream.
Pause for ten seconds before revealing
Why does HMR expose lifecycle bugs so quickly?
With reliable lifecycles, services and events can become stable cooperation protocols.