/** * Forks the effect in the specified scope. The fiber will be interrupted * when the scope is closed. * * @tsplus static effect/core/io/Effect.Aspects forkIn * @tsplus pipeable effect/core/io/Effect forkIn */ export function forkIn(scope: Scope) { return (self: Effect): Effect> => Effect.uninterruptibleMask(({ restore }) => restore(self) .forkDaemon .tap((fiber) => scope.addFinalizer(fiber.interrupt)) ) }