( effect: Effect.Effect<A, E, R>, parentFiber: FiberRuntime<B, E2>, parentRuntimeFlags: RuntimeFlags.RuntimeFlags, overrideScope: fiberScope.FiberScope | null = null )
| 2468 | |
| 2469 | /** @internal */ |
| 2470 | export const unsafeMakeChildFiber = <A, E, R, E2, B>( |
| 2471 | effect: Effect.Effect<A, E, R>, |
| 2472 | parentFiber: FiberRuntime<B, E2>, |
| 2473 | parentRuntimeFlags: RuntimeFlags.RuntimeFlags, |
| 2474 | overrideScope: fiberScope.FiberScope | null = null |
| 2475 | ): FiberRuntime<A, E> => { |
| 2476 | const childId = FiberId.unsafeMake() |
| 2477 | const parentFiberRefs = parentFiber.getFiberRefs() |
| 2478 | const childFiberRefs = fiberRefs.forkAs(parentFiberRefs, childId) |
| 2479 | const childFiber = new FiberRuntime<A, E>(childId, childFiberRefs, parentRuntimeFlags) |
| 2480 | const childContext = fiberRefs.getOrDefault( |
| 2481 | childFiberRefs, |
| 2482 | core.currentContext as unknown as FiberRef.FiberRef<Context.Context<R>> |
| 2483 | ) |
| 2484 | const supervisor = childFiber.currentSupervisor |
| 2485 | |
| 2486 | supervisor.onStart( |
| 2487 | childContext, |
| 2488 | effect, |
| 2489 | Option.some(parentFiber), |
| 2490 | childFiber |
| 2491 | ) |
| 2492 | |
| 2493 | childFiber.addObserver((exit) => supervisor.onEnd(exit, childFiber)) |
| 2494 | |
| 2495 | const parentScope = overrideScope !== null ? overrideScope : pipe( |
| 2496 | parentFiber.getFiberRef(core.currentForkScopeOverride), |
| 2497 | Option.getOrElse(() => parentFiber.scope()) |
| 2498 | ) |
| 2499 | |
| 2500 | parentScope.add(parentRuntimeFlags, childFiber) |
| 2501 | |
| 2502 | return childFiber |
| 2503 | } |
| 2504 | |
| 2505 | /* @internal */ |
| 2506 | const forkWithScopeOverride = <A, E, R>( |
no test coverage detected