Skip to content

Commit

Permalink
chore: Require parallelism >= 1 in MapAsync and MapAsyncUnordered (#1700
Browse files Browse the repository at this point in the history
)
  • Loading branch information
He-Pin authored Jan 10, 2025
1 parent 18e98d4 commit b160861
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,7 @@ private[stream] object Collect {
*/
@InternalApi private[pekko] final case class MapAsync[In, Out](parallelism: Int, f: In => Future[Out])
extends GraphStage[FlowShape[In, Out]] {
require(parallelism >= 1, "parallelism must be at least 1")

import MapAsync._

Expand Down Expand Up @@ -1388,6 +1389,7 @@ private[stream] object Collect {
*/
@InternalApi private[pekko] final case class MapAsyncUnordered[In, Out](parallelism: Int, f: In => Future[Out])
extends GraphStage[FlowShape[In, Out]] {
require(parallelism >= 1, "parallelism must be at least 1")

private val in = Inlet[In]("MapAsyncUnordered.in")
private val out = Outlet[Out]("MapAsyncUnordered.out")
Expand Down

0 comments on commit b160861

Please sign in to comment.