He-Pin commented on code in PR #275:
URL: https://github.com/apache/incubator-pekko/pull/275#discussion_r1284190648
##########
stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/HubSpec.scala:
##########
@@ -305,6 +305,52 @@ class HubSpec extends StreamSpec {
f2.futureValue should ===(1 to 10)
}
+ "broadcast elements to downstream after at least one subscriber" in {
+ val broadcast = Source(1 to 10).runWith(BroadcastHub.sink[Int](1, 256))
+ val resultOne = broadcast.runWith(Sink.seq) // nothing happening yet
+
+ Await.result(resultOne, 1.second) should be(1 to 10) // fails
+ }
+
+ "broadcast all elements to all consumers" in {
+ val sourceQueue = Source.queue[Int](10) // used to block the source
until we say so
+ val (queue, broadcast) = sourceQueue.toMat(BroadcastHub.sink(2,
256))(Keep.both).run()
Review Comment:
@pjfanning This is the test.
--
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]