From a83e748a3e19ae7b9ef340668aee57ed02401adc Mon Sep 17 00:00:00 2001 From: He-Pin Date: Sun, 3 Sep 2023 20:40:38 +0800 Subject: [PATCH] =str Make decider a lazy val. --- .../main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala index e3c20d7e959..2b2eb947051 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/fusing/Ops.scala @@ -664,7 +664,7 @@ private[stream] object Collect { def createLogic(inheritedAttributes: Attributes): GraphStageLogic = new GraphStageLogic(shape) with InHandler with OutHandler { - val decider = inheritedAttributes.mandatoryAttribute[SupervisionStrategy].decider + lazy val decider = inheritedAttributes.mandatoryAttribute[SupervisionStrategy].decider private var aggregator: Out = zero private var aggregating: Future[Out] = Future.successful(aggregator) @@ -1402,8 +1402,7 @@ private[stream] object Collect { new GraphStageLogic(shape) with InHandler with OutHandler { override def toString = s"MapAsyncUnordered.Logic(inFlight=$inFlight, buffer=$buffer)" - private val decider = - inheritedAttributes.mandatoryAttribute[SupervisionStrategy].decider + private lazy val decider = inheritedAttributes.mandatoryAttribute[SupervisionStrategy].decider private var inFlight = 0 private var buffer: BufferImpl[Out] = _