Zio: Add Stream#mapAsync and Stream#mapAsyncUnordered

Created on 7 May 2019  路  2Comments  路  Source: zio/zio

Signature:

trait Stream[R, E, A] {
  def mapAsync(n: Int)(f: A => ZIO[R1, E1, B]): Stream[R1, E1, B]
  def mapAsyncUnordered(n: Int)(f: A => ZIO[R1, E1, B]): Stream[R1, E1, B]
}

The first should execute up to n transformations in parallel and emit elements in the same order. The second is identical but can emit elements in the order of completion of f invocations.

enhancement good first issue stream

Most helpful comment

I'll give it a try. :)

All 2 comments

Also, possible aliases: mapMPar, mapMParUnordered

I'll give it a try. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jdegoes picture jdegoes  路  4Comments

jdegoes picture jdegoes  路  4Comments

jdegoes picture jdegoes  路  3Comments

adamgfraser picture adamgfraser  路  4Comments

NeQuissimus picture NeQuissimus  路  3Comments