Problem: there’s a source that contains events that appear there as they happen in the system (through
Source.queue()), then it runs through
scan() to be consumed by an unknown number of subscribers that come at arbitrary points in time. For each subscriber, I want to give it a summary of what it has missed (by re-creating the missed events from the collected statistics) and then to keep feeding it new events as they arrive.
My first move was to just place a
BroadcastHub after the
scan(), but it obviously doesn’t work, because an existing subscriber can drain it, and then a new subscriber doesn’t get anything until an event happens. I need it to get the events right away.
Is there a way to do it using Akka Streams, short of writing my own