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

Function parallelNFinalizers

packages/effect/src/internal/fiberRuntime.ts:2800–2814  ·  view source on GitHub ↗
(parallelism: number)

Source from the content-addressed store, hash-verified

2798/* @internal */
2799export const parallelNFinalizers =
2800 (parallelism: number) => <A, E, R>(self: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
2801 core.contextWithEffect((context) =>
2802 Option.match(Context.getOption(context, scopeTag), {
2803 onNone: () => self,
2804 onSome: (scope) => {
2805 if (scope.strategy._tag === "ParallelN" && scope.strategy.parallelism === parallelism) {
2806 return self
2807 }
2808 return core.flatMap(
2809 core.scopeFork(scope, ExecutionStrategy.parallelN(parallelism)),
2810 (inner) => scopeExtend(self, inner)
2811 )
2812 }
2813 })
2814 )
2815
2816/* @internal */
2817export const finalizersMask = (strategy: ExecutionStrategy.ExecutionStrategy) =>

Callers 1

finalizersMaskInternalFunction · 0.85

Calls 1

getOptionMethod · 0.65

Tested by

no test coverage detected