MCPcopy Index your code
hub / github.com/Effect-TS/effect / checkDone

Function checkDone

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

Source from the content-addressed store, hash-verified

3729 core.async<void, E>((cb) => {
3730 const counts = entries.map((_) => _.listeners.count)
3731 const checkDone = () => {
3732 if (counts.every((count) => count === 0)) {
3733 if (
3734 entries.every((_) => {
3735 if (_.result.state.current._tag === "Pending") {
3736 return true
3737 } else if (
3738 _.result.state.current._tag === "Done" &&
3739 core.exitIsExit(_.result.state.current.effect) &&
3740 _.result.state.current.effect._tag === "Failure" &&
3741 internalCause.isInterrupted(_.result.state.current.effect.cause)
3742 ) {
3743 return true
3744 } else {
3745 return false
3746 }
3747 })
3748 ) {
3749 cleanup.forEach((f) => f())
3750 onInterrupt?.()
3751 cb(core.interruptFiber(processing))
3752 }
3753 }
3754 }
3755 processing.addObserver((exit) => {
3756 cleanup.forEach((f) => f())
3757 cb(exit)

Callers 2

observerFunction · 0.85
invokeWithInterruptFunction · 0.85

Calls 2

isInterruptedMethod · 0.80
fFunction · 0.50

Tested by

no test coverage detected