mogami-stream - v0.2.0
    Preparing search index...

    Function map

    • Transforms each value with bounded concurrency, awaiting the mapper's result.

      Defaults to concurrency: 1, capacity: concurrency, and ordered: true. An unhandled mapper error immediately stops the execution, even if earlier items are still in flight. When retry is configured, only the failed mapper invocation for that item is retried while holding its concurrency and capacity slot.

      Type Parameters

      • T
      • U

      Parameters

      Returns Operator<T, Awaited<U>>

      If concurrency, capacity, or retry options are invalid.

      const values = await range(0, 3)
      .pipe(map(value => value * 2, { concurrency: 2 }))
      .toArray(); // [0, 2, 4]