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

Function onExit

packages/effect/src/Micro.ts:1422–1433  ·  view source on GitHub ↗
(exit: MicroExit<any, any>)

Source from the content-addressed store, hash-verified

1420 const fibers = new Set<MicroFiber<any, any>>()
1421 const causes: Array<MicroCause<any>> = []
1422 const onExit = (exit: MicroExit<any, any>) => {
1423 doneCount++
1424 if (exit._tag === "Failure") {
1425 causes.push(exit.cause)
1426 if (doneCount >= len) {
1427 resume(failCause(causes[0]))
1428 }
1429 return
1430 }
1431 done = true
1432 resume(fibers.size === 0 ? exit : flatMap(uninterruptible(fiberInterruptAll(fibers)), () => exit))
1433 }
1434
1435 for (let i = 0; i < len; i++) {
1436 if (done) break

Callers 6

raceAllFunction · 0.70
raceAllFirstFunction · 0.70
Micro.tsFile · 0.70
scopedFunction · 0.70
core.tsFile · 0.50
runMethod · 0.50

Calls 4

fiberInterruptAllFunction · 0.85
resumeFunction · 0.70
uninterruptibleFunction · 0.70
failCauseFunction · 0.50

Tested by

no test coverage detected