pjfanning commented on code in PR #3392:
URL: https://github.com/apache/pekko/pull/3392#discussion_r3662654239
##########
stream/src/main/scala/org/apache/pekko/stream/javadsl/Hub.scala:
##########
@@ -69,6 +69,34 @@ object MergeHub {
pekko.stream.scaladsl.MergeHub.source[T](perProducerBufferSize).mapMaterializedValue(_.asJava[T]).asJava
}
+ /**
+ * Creates a [[Source]] that emits elements merged from a dynamic set of
producers. After the [[Source]] returned
+ * by this method is materialized, it returns a [[Sink]] as a materialized
value. This [[Sink]] can be materialized
+ * arbitrary many times and each of the materializations will feed the
elements into the original [[Source]].
+ *
+ * Every new materialization of the [[Source]] results in a new, independent
hub, which materializes to its own
+ * [[Sink]] for feeding that materialization.
+ *
+ * Completed or failed [[Sink]]s are simply removed. Once the [[Source]] is
cancelled, the Hub is considered closed
+ * and any new producers using the [[Sink]] will be cancelled.
+ *
+ * @param clazz Type of elements this hub emits and consumes
+ * @param perProducerBufferSize Buffer space used per producer.
+ * @param maxTotalBufferSize Admission threshold for the total number of
elements buffered across all producers.
+ * New producers are cancelled at registration when the buffered element
count meets or exceeds this value.
+ * Transient overshoot up to the per-producer buffer of concurrently
admitted producers is possible.
+ * Use 0 for unlimited (default behavior).
+ */
Review Comment:
`@since 2.0.0`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]