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

Function collectExits

packages/effect/src/internal/fiberRuntime.ts:2236–2245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2234 const joinOrder = new Array<FiberRuntime<Exit.Exit<X, E> | Effect.Blocked<X, E>>>()
2235 const residual = new Array<core.Blocked>()
2236 const collectExits = () => {
2237 const exits: Array<Exit.Exit<any, E>> = results
2238 .filter(({ exit }) => exit._tag === "Failure")
2239 .sort((a, b) => a.index < b.index ? -1 : a.index === b.index ? 0 : 1)
2240 .map(({ exit }) => exit)
2241 if (exits.length === 0) {
2242 exits.push(core.exitVoid)
2243 }
2244 return exits
2245 }
2246 const runFiber = <A, E, R>(eff: Effect.Effect<A, E, R>, interruptImmediately = false) => {
2247 const runnable = core.uninterruptible(graft(eff))
2248 const fiber = unsafeForkUnstarted(

Callers 1

nextFunction · 0.85

Calls 1

mapMethod · 0.65

Tested by

no test coverage detected