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

Method inheritAll

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

Source from the content-addressed store, hash-verified

475 }
476
477 get inheritAll(): Effect.Effect<void> {
478 return core.withFiberRuntime((parentFiber, parentStatus) => {
479 const parentFiberId = parentFiber.id()
480 const parentFiberRefs = parentFiber.getFiberRefs()
481 const parentRuntimeFlags = parentStatus.runtimeFlags
482 const childFiberRefs = this.getFiberRefs()
483 const updatedFiberRefs = fiberRefs.joinAs(parentFiberRefs, parentFiberId, childFiberRefs)
484
485 parentFiber.setFiberRefs(updatedFiberRefs)
486
487 const updatedRuntimeFlags = parentFiber.getFiberRef(currentRuntimeFlags)
488
489 const patch = pipe(
490 runtimeFlags_.diff(parentRuntimeFlags, updatedRuntimeFlags),
491 // Do not inherit WindDown or Interruption!
492 RuntimeFlagsPatch.exclude(runtimeFlags_.Interruption),
493 RuntimeFlagsPatch.exclude(runtimeFlags_.WindDown)
494 )
495
496 return core.updateRuntimeFlags(patch)
497 })
498 }
499
500 /**
501 * Tentatively observes the fiber, but returns immediately if it is not

Callers 2

raceAllFunction · 0.80
channelExecutor.tsFile · 0.80

Calls 7

getFiberRefsMethod · 0.95
setFiberRefsMethod · 0.80
pipeFunction · 0.70
idMethod · 0.65
getFiberRefsMethod · 0.65
getFiberRefMethod · 0.65
diffMethod · 0.65

Tested by

no test coverage detected