What could be an alternative to dynamically changing graphics? Here is my situation. I have a chart that swallows articles in the database. Articles are taken from 3 plugins in a different format. So I have multiple threads
val converterFlow1: Flow[ImpArticle, Article, NotUsed]
val converterFlow2: Flow[NewsArticle, Article, NotUsed]
val sinkDB: Sink[Article, Future[Done]]
// These are being created every time I poll plugins
val sourceContentProvider : Source[ImpArticle, NotUsed]
val sourceNews : Source[NewsArticle, NotUsed]
val sourceCit : Source[Article, NotUsed]
val merged = Source.combine(
sourceContentProvider.via(converterFlow1),
sourceNews.via(converterFlow2),
sourceCit)(Merge(_))
val res = merged
.buffer(10, OverflowStrategy.backpressure)
.toMat(sinkDB)(Keep.both)
.run()
The problem is that I receive data from the content provider once every 24 hours, from the news once every 2 hours, and the last source can appear at any time, because it comes from people.
I understand that the graphs are immutable, but how can I periodically attach new instances Sourceto my graph so that I have a single throttle point for the swallowing process?
UPDATE: , - Source -s, . , Source ( ). . , Source.