I want to build a play application fetching different API's, persisting the processed results and stream the results via WebSockets to web clients.
I have N actors for N API's in the main controller who are injected by AkkaGuice.
Then I have N GraphStages that are in fact responsible for the whole process of getting Data from the DataSources do all the preprocessing, persisting the data and publishing the data to the ActorSystem event stream.
I really enjoy the idiomatic approach writing data processing logic with the graph DSL but publishing the data on the EventStream feels wrong.
I thought something about to have a single graph stage that I inject inside the controller by starting the app which handles the whole fetching and persistence logic but also is able to distribute the data to the dynamical group of user actors but without publishing it to the EventStream
Is there an idiomatic approach to solving my problem?
Thanks
Ivan