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