How it works...
In this recipe, we covered how to use the aggregator pattern. This pattern is commonly used to aggregate data from different locations and package the result as a single data unit. In our case, we aggregate posts from different social networks, we get results for a period of time, and then we log a small report for it.
The SocialMediaHandler actors are responsible for simulating access to the different social networks. When they get a GetLatestPosts message, they generate a random number of posts and send them back. The SocialMediaStalker actor is responsible for asking the aggregator to get some data from those social networks and once it's done, it logs a report of the number of posts per social network there are.
The interesting ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access