He-Pin commented on code in PR #2422:
URL: https://github.com/apache/pekko/pull/2422#discussion_r2485034895
##########
stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala:
##########
@@ -247,6 +247,23 @@ object Source {
def single[T](element: T): Source[T, NotUsed] =
new Source(scaladsl.Source.single(element))
+ /**
+ * Create a `Source` from the given elements.
+ *
+ * @since 1.3.0
+ */
+ @varargs
+ @SafeVarargs
+ def elements[T](elements: T*): javadsl.Source[T, NotUsed] = {
+ if (elements.isEmpty) {
+ empty()
+ } else if (elements.length == 1) {
+ single(elements.head)
+ } else {
+ new Source(scaladsl.Source(elements))
Review Comment:
This line needs to be adjusted when merging into 1.3.x
--
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]