MCPcopy Create free account
hub / github.com/Effect-TS/effect / handleExit

Function handleExit

packages/experimental/src/Reactivity.ts:103–120  ·  view source on GitHub ↗
(exit: Exit.Exit<A, E>)

Source from the content-addressed store, hash-verified

101 let pending = false
102 let stopped = false
103 const handleExit = (exit: Exit.Exit<A, E>) => {
104 if (exit._tag === "Failure") {
105 stopped = true
106 pending = false
107 running = false
108 cancel()
109 results.unsafeDone(Exit.failCause(exit.cause))
110 return
111 } else {
112 results.unsafeOffer(exit.value)
113 }
114 if (pending) {
115 pending = false
116 runFork(effect).addObserver(handleExit)
117 } else {
118 running = false
119 }
120 }
121
122 function run() {
123 if (stopped) return

Callers

nothing calls this directly

Calls 6

cancelFunction · 0.85
unsafeDoneMethod · 0.80
failCauseMethod · 0.80
unsafeOfferMethod · 0.65
addObserverMethod · 0.65
runForkFunction · 0.50

Tested by

no test coverage detected