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

Function loop

packages/effect/src/internal/effect.ts:950–964  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

948 const exits: Array<Exit.Exit<any, any>> = []
949 let cancel: (() => void) | undefined = undefined
950 function loop() {
951 while (exits.length < fibers.length) {
952 const fiber = fibers[exits.length]
953 if (fiber._exit) {
954 exits.push(fiber._exit)
955 continue
956 }
957 cancel = fiber.addObserver((exit) => {
958 exits.push(exit)
959 loop()
960 })
961 return
962 }
963 resume(succeed(exits))
964 }
965 loop()
966 return sync(() => cancel?.())
967 }, fibers)

Callers 2

fiberAwaitAllFunction · 0.70
effect.tsFile · 0.70

Calls 5

addObserverMethod · 0.80
succeedFunction · 0.70
pushMethod · 0.65
nextMethod · 0.65
resumeFunction · 0.50

Tested by

no test coverage detected