| 2224 | const joinOrder = new Array<FiberRuntime<Exit.Exit<X, E> | Effect.Blocked<X, E>>>() |
| 2225 | const residual = new Array<core.Blocked>() |
| 2226 | const collectExits = () => { |
| 2227 | const exits: Array<Exit.Exit<any, E>> = results |
| 2228 | .filter(({ exit }) => exit._tag === "Failure") |
| 2229 | .sort((a, b) => a.index < b.index ? -1 : a.index === b.index ? 0 : 1) |
| 2230 | .map(({ exit }) => exit) |
| 2231 | if (exits.length === 0) { |
| 2232 | exits.push(core.exitVoid) |
| 2233 | } |
| 2234 | return exits |
| 2235 | } |
| 2236 | const runFiber = <A, E, R>(eff: Effect.Effect<A, E, R>, interruptImmediately = false) => { |
| 2237 | const runnable = core.uninterruptible(graft(eff)) |
| 2238 | const fiber = unsafeForkUnstarted( |