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

Function matchSimple

packages/effect/src/internal/concurrency.ts:33–54  ·  view source on GitHub ↗
(
  concurrency: Concurrency | undefined,
  sequential: () => Effect<A, E, R>,
  concurrent: () => Effect<A, E, R>
)

Source from the content-addressed store, hash-verified

31
32/** @internal */
33export const matchSimple = <A, E, R>(
34 concurrency: Concurrency | undefined,
35 sequential: () => Effect<A, E, R>,
36 concurrent: () => Effect<A, E, R>
37): Effect<A, E, R> => {
38 switch (concurrency) {
39 case undefined:
40 return sequential()
41 case "unbounded":
42 return concurrent()
43 case "inherit":
44 return core.fiberRefGetWith(
45 core.currentConcurrency,
46 (concurrency) =>
47 concurrency === "unbounded" || concurrency > 1 ?
48 concurrent() :
49 sequential()
50 )
51 default:
52 return concurrency > 1 ? concurrent() : sequential()
53 }
54}

Callers

nothing calls this directly

Calls 1

sequentialFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…