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

Function forEachParUnbounded

packages/effect/src/internal/fiberRuntime.ts:2180–2190  ·  view source on GitHub ↗
(
  self: Iterable<A>,
  f: (a: A, i: number) => Effect.Effect<B, E, R>,
  batching: boolean
)

Source from the content-addressed store, hash-verified

2178
2179/* @internal */
2180export const forEachParUnbounded = <A, B, E, R>(
2181 self: Iterable<A>,
2182 f: (a: A, i: number) => Effect.Effect<B, E, R>,
2183 batching: boolean
2184): Effect.Effect<Array<B>, E, R> =>
2185 core.suspend(() => {
2186 const as = RA.fromIterable(self)
2187 const array = new Array<B>(as.length)
2188 const fn = (a: A, i: number) => core.flatMap(f(a, i), (b) => core.sync(() => array[i] = b))
2189 return core.zipRight(forEachConcurrentDiscard(as, fn, batching, false), core.succeed(array))
2190 })
2191
2192/** @internal */
2193export const forEachConcurrentDiscard = <A, X, E, R>(

Callers 3

fiberRuntime.tsFile · 0.85
closeFunction · 0.85
fiberAllFunction · 0.85

Calls 1

forEachConcurrentDiscardFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…