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

Function loop

packages/cluster/src/internal/fiber.ts:11–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 let cause: Cause.Cause<E> | undefined = undefined
10 let i = 0
11 function loop() {
12 while (i < fibers.length) {
13 const fiber = fibers[i]
14 const exit = fiber.unsafePoll()
15 if (exit) {
16 i++
17 if (exit._tag === "Success") continue
18 cause = cause ? Cause.parallel(cause, exit.cause) : exit.cause
19 continue
20 }
21 fiber.addObserver(onExit)
22 return
23 }
24 resume(cause ? Effect.failCause(cause) : Effect.void)
25 }
26 function onExit(exit: Exit.Exit<A, E>) {
27 i++
28 if (exit._tag === "Failure") {

Callers 2

onExitFunction · 0.70
joinAllDiscardFunction · 0.70

Calls 4

failCauseMethod · 0.80
unsafePollMethod · 0.65
addObserverMethod · 0.65
resumeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…