// ets_tracing: off import type * as T from "../../../../Effect/index.js" import type * as C from "../core.js" import * as ChainPar from "./chainPar.js" import * as FromEffect from "./fromEffect.js" /** * Maps over elements of the stream with the specified effectful function, * executing up to `n` invocations of `f` concurrently. The element order * is not enforced by this combinator, and elements may be reordered. */ export function mapEffectParUnordered_( self: C.Stream, n: number, f: (a: A) => T.Effect ): C.Stream { return ChainPar.chainPar_(self, n, (a) => FromEffect.fromEffect(f(a))) } /** * Maps over elements of the stream with the specified effectful function, * executing up to `n` invocations of `f` concurrently. The element order * is not enforced by this combinator, and elements may be reordered. * * @ets_data_first mapEffectParUnordered_ */ export function mapEffectParUnordered( n: number, f: (a: A) => T.Effect ) { return (self: C.Stream) => mapEffectParUnordered_(self, n, f) }