He-Pin commented on code in PR #1611: URL: https://github.com/apache/pekko/pull/1611#discussion_r1889086396
########## stream/src/main/scala/org/apache/pekko/stream/scaladsl/SourceWithContext.scala: ########## @@ -57,36 +57,44 @@ object SourceWithContext { SourceWithContext.fromTuples(Source.fromGraph(GraphDSL.createGraph(source, viaFlow)(combine) { implicit b => (s, viaF) => import GraphDSL.Implicits._ - val broadcast = b.add(Broadcast[(Option[SOut], Ctx)](2)) - val merge = b.add(Merge[(Option[FOut], Ctx)](2)) - val unzip = b.add(Unzip[SOut, Ctx]()) - val zipper = b.add(Zip[FOut, Ctx]()) - - val filterAvailable = Flow[(Option[SOut], Ctx)].collect { - case (Some(f), ctx) => (f, ctx) - } - - val filterUnavailable = Flow[(Option[SOut], Ctx)].collect { - case (None, ctx) => (Option.empty[FOut], ctx) + case class IndexedCtx(idx: Long, ctx: Ctx) Review Comment: extra allocation here -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For additional commands, e-mail: notifications-h...@pekko.apache.org