Hello hAkkers,
I've got so very weird situation when 'MergeHub.source' with merged in it
'Source.repeat(..).delay(..)' slowly decreases consumption rate of
materialized Sinks.
Some simple synthetic test follows:
import java.time.Instant
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Keep, MergeHub, Sink, Source}
import scala.concurrent.duration._
object DelayTest extends App {
implicit val as = ActorSystem("delay")
implicit val am = ActorMaterializer()
val ticker = Source
.tick(0.second, 1.second, List('first, 'second, 'third, 'fourth, 'fifth,
'sixth))
.mapConcat(identity)
val hub = MergeHub
.source[Symbol]
.merge {
Source.repeat('repeat).delay(15.seconds)
}
.toMat(Sink.foreach { s =>
println(s"${Instant.now()} -- got [$s].")
})(Keep.left)
.run()
ticker.runWith(hub)
}
When run, messages from 'ticker' will appear through constantly increasing
intervals.
As soon as we change 'Source.repeat(..).delay(..)' to 'Source.tick(..)' -
problem disappears.
What could be a possible cause for this weird mechanics?
P.S.: Scala 2.12.1, Akka 2.4.17, Java 1.8.0_112.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.