MCPcopy Create free account
hub / github.com/Effect-TS/effect / allSuccesses

Function allSuccesses

packages/effect/src/internal/fiberRuntime.ts:2020–2031  ·  view source on GitHub ↗
(
  elements: Iterable<Eff>,
  options?: {
    readonly concurrency?: Concurrency | undefined
    readonly batching?: boolean | "inherit" | undefined
    readonly concurrentFinalizers?: boolean | undefined
  }
)

Source from the content-addressed store, hash-verified

2018
2019/* @internal */
2020export const allSuccesses = <Eff extends Effect.Effect<any, any, any>>(
2021 elements: Iterable<Eff>,
2022 options?: {
2023 readonly concurrency?: Concurrency | undefined
2024 readonly batching?: boolean | "inherit" | undefined
2025 readonly concurrentFinalizers?: boolean | undefined
2026 }
2027): Effect.Effect<Array<Effect.Effect.Success<Eff>>, never, Effect.Effect.Context<Eff>> =>
2028 core.map(
2029 all(RA.fromIterable(elements).map(core.exit), options),
2030 RA.filterMap((exit) => core.exitIsSuccess(exit) ? Option.some(exit.effect_instruction_i0) : Option.none())
2031 )
2032
2033/* @internal */
2034export const replicate = dual<

Callers

nothing calls this directly

Calls 2

allFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected