pjfanning commented on code in PR #1831:
URL: https://github.com/apache/pekko/pull/1831#discussion_r2188751233
##########
stream/src/main/scala/org/apache/pekko/stream/scaladsl/Source.scala:
##########
@@ -108,6 +108,21 @@ final class Source[+Out, +Mat](
(mat, Source.fromPublisher(pub))
}
+ /**
+ * Materializes this [[Source]] using the [[Sink]], immediately returning
the values via the
+ * provided [[Sink]] as a new [[Source]].
+ *
+ * @param sink A sink which needs to materialize into a [[Future]],
typically one
+ * that collects values such as [[Sink.head]] or [[Sink.seq]]
+ * @return A new [[Source]] that contains the results of the provided
[[Source]]'s
+ * elements run with the [[Sink]]
+ * @since 1.2.0
+ */
+ def preMaterializeIntoSource[Mat2](sink: Graph[SinkShape[Out],
Future[Mat2]]): Source[Mat2, Future[NotUsed]] =
+ Source.fromMaterializer { (mat, attr) =>
+
Source.future(this.withAttributes(attr).toMat(sink)(Keep.right).run()(mat))
Review Comment:
@mdedetrich I'm hoping to do a 1.2.0-M2 release in the next week or 2. Is PR
in a position to be completed in that time frame?
--
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]