You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2023/09/23 11:05:33 UTC
[GitHub] [incubator-pekko] He-Pin commented on a diff in pull request #676: =str Tweak the stream mapAsyncPartitioned operator
He-Pin commented on code in PR #676:
URL: https://github.com/apache/incubator-pekko/pull/676#discussion_r1334967965
##########
stream/src/main/scala/org/apache/pekko/stream/javadsl/FlowWithContext.scala:
##########
@@ -173,39 +173,36 @@ final class FlowWithContext[In, CtxIn, Out, CtxOut, +Mat](
def map[Out2](f: function.Function[Out, Out2]): FlowWithContext[In, CtxIn, Out2, CtxOut, Mat] =
viaScala(_.map(f.apply))
+ /**
+ * Context-preserving variant of [[pekko.stream.javadsl.Flow.mapAsync]].
+ *
+ * @see [[pekko.stream.javadsl.Flow.mapAsync]]
+ */
def mapAsync[Out2](
parallelism: Int,
f: function.Function[Out, CompletionStage[Out2]]): FlowWithContext[In, CtxIn, Out2, CtxOut, Mat] =
viaScala(_.mapAsync[Out2](parallelism)(o => f.apply(o).asScala))
/**
- * Transforms this stream. Works very similarly to [[#mapAsync]] but with an additional
- * partition step before the transform step. The transform function receives the an individual
- * stream entry and the calculated partition value for that entry.
+ * Context-preserving variant of [[pekko.stream.javadsl.Flow.mapAsyncPartitioned]].
*
- * @since 1.1.0
- * @see [[#mapAsync]]
- * @see [[#mapAsyncPartitionedUnordered]]
+ * @see [[pekko.stream.javadsl.Flow.mapAsyncPartitioned]]
*/
def mapAsyncPartitioned[Out2, P](parallelism: Int,
- extractPartition: function.Function[Out, P],
+ partitioner: function.Function[Out, P],
f: function.Function2[Out, P, CompletionStage[Out2]]): FlowWithContext[In, CtxIn, Out2, CtxOut, Mat] = {
- viaScala(_.mapAsyncPartitioned(parallelism)(extractPartition(_))(f(_, _).asScala))
+ viaScala(_.mapAsyncPartitioned(parallelism)(partitioner(_))(f(_, _).asScala))
}
/**
- * Transforms this stream. Works very similarly to [[#mapAsyncUnordered]] but with an additional
- * partition step before the transform step. The transform function receives the an individual
- * stream entry and the calculated partition value for that entry.
+ * Context-preserving variant of [[pekko.stream.javadsl.Flow.mapAsyncPartitionedUnordered]].
*
- * @since 1.1.0
Review Comment:
Oops, I will add it back.
--
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-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org