Skip to content

Commit 40f88cd

Browse files
committed
chore: Require parallelism >= 1 in MapAsync and MapAsyncUnordered
1 parent 0bf6606 commit 40f88cd

File tree

1 file changed

+2
-0
lines changed
  • stream/src/main/scala/org/apache/pekko/stream/impl/fusing

1 file changed

+2
-0
lines changed

stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala

+2
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,7 @@ private[stream] object Collect {
12811281
*/
12821282
@InternalApi private[pekko] final case class MapAsync[In, Out](parallelism: Int, f: In => Future[Out])
12831283
extends GraphStage[FlowShape[In, Out]] {
1284+
require(parallelism >= 1, "parallelism must be at least 1")
12841285

12851286
import MapAsync._
12861287

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

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

0 commit comments

Comments
 (0)