| 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( |